From 0de15ae2403694b02de584ed5eee38d7c6e27b8b Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 25 Nov 2026 09:48:16 +0100 Subject: ... --- system-profiles/initrd-ssh/default.nix | 47 ---------------------------------- 1 file changed, 47 deletions(-) delete mode 100644 system-profiles/initrd-ssh/default.nix (limited to 'system-profiles/initrd-ssh/default.nix') diff --git a/system-profiles/initrd-ssh/default.nix b/system-profiles/initrd-ssh/default.nix deleted file mode 100644 index ef469343..00000000 --- a/system-profiles/initrd-ssh/default.nix +++ /dev/null @@ -1,47 +0,0 @@ -{ hostName, config, pkgs, lib, ... }: - -with lib; - -{ - config = { - boot.initrd = { - network = { - enable = true; - ssh = { - enable = true; - hostKeys = [ "/etc/ssh/ssh_host_ed25519_key" "/etc/ssh/ssh_host_rsa_key" ]; - authorizedKeys = config.users.users.root.openssh.authorizedKeys.keys ++ map (kF: builtins.readFile kF) config.users.users.root.openssh.authorizedKeys.keyFiles; - - extraConfig = '' - ForceCommand cryptsetup-askpass - ''; - }; - }; - - secrets = with config.sops.secrets; { - "/etc/ssh/ssh_host_ed25519_key" = mkForce initrd_ssh_host_ed25519_key.path; - "/etc/ssh/ssh_host_rsa_key" = mkForce initrd_ssh_host_rsa_key.path; - }; - - extraFiles = let - mkPubkey = typ: pkgs.runCommand "ssh_host_${typ}_key.pub" { buildInputs = with pkgs; [ yq ]; } '' - yq -r '.${typ}' ${./host-keys + "/${hostName}-public.yaml"} > $out - ''; - in { - "/etc/ssh/ssh_host_rsa_key.pub".source = mkPubkey "rsa"; - "/etc/ssh/ssh_host_ed25519_key.pub".source = mkPubkey "ed25519"; - }; - }; - - sops.secrets = { - initrd_ssh_host_rsa_key = { - key = "rsa"; - sopsFile = ./host-keys + "/${hostName}-private.yaml"; - }; - initrd_ssh_host_ed25519_key = { - key = "ed25519"; - sopsFile = ./host-keys + "/${hostName}-private.yaml"; - }; - }; - }; -} -- cgit v1.2.3