summaryrefslogtreecommitdiffstats
path: root/krebs/5pkgs/simple/generate-secrets
diff options
context:
space:
mode:
authorlassulus <git@lassul.us>2026-01-11 01:29:31 +0100
committerlassulus <git@lassul.us>2026-01-11 01:29:31 +0100
commit68d3c925b0edb958fcbafa589d35967dfb2a979c (patch)
tree82018f93e411fcad47cb45867c646ce0f8feb683 /krebs/5pkgs/simple/generate-secrets
parent39ef2da7d30dba7c5c1556ffa90d330a9607bb44 (diff)
5pkgs: fix nix flake show compatibility
Integrate nix-writers flake for extended writer functions (writeJq, writeGawkBin, etc.) using a fixpoint overlay so functions can reference each other. Update Python packages to new buildPythonPackage format: - Add pyproject = true and build-system for ovh-zone, python-dnsstamps, ssh-audit, tinc_graphs Fix writer function usage by taking them as arguments instead of accessing via pkgs: - nixos-format-error, untilport, qrscan, logf, gitignore, urix, etc. Update deprecated nixpkgs attribute names: - gdk_pixbuf -> gdk-pixbuf - libSM/libX11/libXinerama -> xorg.* - buildGo120Module -> buildGoModule Remove obsolete/broken packages: - buildbot-classic-slave (missing buildbot-classic) - cac-panel, drivedroid-gen-repo (Python 2 / format issues) - games-user-env, generate-secrets (unused) - internetarchive, bepasty-client-cli, krebspaste (Python 2) - qrscan (conflicts with removed nixpkgs package) Other fixes: - Use lib.callPackageWith for package interdependencies - Only export derivations in flake packages output - Limit packages output to Linux systems - Fix IFD in ukrepl by passing path to writer instead of readFile - Import stockholm.lib directly where needed (bling) - Rewrite brain and git-hooks to use runCommand
Diffstat (limited to 'krebs/5pkgs/simple/generate-secrets')
-rw-r--r--krebs/5pkgs/simple/generate-secrets/default.nix49
1 files changed, 0 insertions, 49 deletions
diff --git a/krebs/5pkgs/simple/generate-secrets/default.nix b/krebs/5pkgs/simple/generate-secrets/default.nix
deleted file mode 100644
index 8522b5dda..000000000
--- a/krebs/5pkgs/simple/generate-secrets/default.nix
+++ /dev/null
@@ -1,49 +0,0 @@
-{ pkgs }:
-pkgs.writers.writeDashBin "generate-secrets" ''
- set -eu
- HOSTNAME="$1"
- TMPDIR=$(${pkgs.coreutils}/bin/mktemp -d)
- cd $TMPDIR
-
- PASSWORD=$(${pkgs.pwgen}/bin/pwgen 25 1)
- HASHED_PASSWORD=$(echo $PASSWORD | ${pkgs.hashPassword}/bin/hashPassword -s) > /dev/null
-
- ${pkgs.openssh}/bin/ssh-keygen -t ed25519 -f $TMPDIR/ssh.id_ed25519 -P "" -C "" >/dev/null
- ${pkgs.tinc_pre}/bin/tinc --config "$TMPDIR" generate-keys 4096 >/dev/null
- cat <<EOF > $TMPDIR/hashedPasswords.nix
- {
- root = "$HASHED_PASSWORD";
- }
- EOF
-
- for x in *; do
- ${pkgs.coreutils}/bin/cat $x | ${pkgs.brain}/bin/brain insert -m krebs-secrets/$HOSTNAME/$x > /dev/null
- done
- echo $PASSWORD | ${pkgs.brain}/bin/brain insert -m hosts/$HOSTNAME/root > /dev/null
-
- cat <<EOF
- $HOSTNAME = {
- owner = config.krebs.users.krebs;
- nets = {
- retiolum = {
- ip4.addr = "10.243.0.changeme";
- ip6.addr = "42:0:0:0:0:0:0:changeme";
- aliases = [
- "$HOSTNAME.r"
- ];
- tinc = {
- pubkey = ${"''"}
- $(cat $TMPDIR/rsa_key.pub)
- ${"''"};
- pubkey_ed25519 = "$(cut -d ' ' -f 3 $TMPDIR/ed25519_key.pub)";
- };
- };
- };
- ssh.privkey.path = "\''${config.krebs.secret.directory}/ssh.id_ed25519";
- ssh.pubkey = "$(cat $TMPDIR/ssh.id_ed25519.pub)";
- };
- EOF
-
- rm -rf $TMPDIR
-''
-