-{ pkgs, lib, config, hosts, ... }:
+{ pkgs, lib, config, hosts, hostName, ... }:
{
services.openssh = {
openFirewall = true;
'';
};
+ security.initrd.secrets."${hostName}/ssh/initrd.key" =
+ "hosts/${hostName}/ssh/initrd.key.gpg";
boot.initrd.network.ssh = {
enable = true;
port = 2222;
authorizedKeys = config.users.users.root.openssh.authorizedKeys.keys;
- hostKeys = [ "/root/initrd/ssh.key" ];
+ hostKeys = [ "${config.security.initrd.stage1Dir}/${hostName}/ssh/initrd.key" ];
extraConfig = ''
'';
};