refactor(nixos): move persisted ssh host keys to ssh module

This commit is contained in:
Mohammad Rafiq 2025-07-07 17:47:51 +08:00
parent 4ff7b8e18f
commit fe91044c8b
No known key found for this signature in database
2 changed files with 10 additions and 7 deletions

View file

@ -17,13 +17,6 @@ in
btrfs subvolume delete "/btrfs_tmp/root"
fi
'';
persistFiles = [
#TODO: move to ssh config
"/etc/ssh/ssh_host_ed25519_key"
"/etc/ssh/ssh_host_ed25519_key.pub"
"/etc/ssh/ssh_host_rsa_key"
"/etc/ssh/ssh_host_rsa_key.pub"
];
})
];
};

10
nix/modules/ssh.nix Normal file
View file

@ -0,0 +1,10 @@
{
flake.modules.nixos.default = {
persistFiles = [
"/etc/ssh/ssh_host_ed25519_key"
"/etc/ssh/ssh_host_ed25519_key.pub"
"/etc/ssh/ssh_host_rsa_key"
"/etc/ssh/ssh_host_rsa_key.pub"
];
};
}