diff --git a/modules/openssh-pregenerated.nix b/modules/openssh-pregenerated.nix index 0e4f173..ff73f34 100644 --- a/modules/openssh-pregenerated.nix +++ b/modules/openssh-pregenerated.nix @@ -1,5 +1,6 @@ let keyFile = "/etc/ssh/ssh_host_ed25519_key"; + persistentKeyFile = "/nix/persistence/${keyFile}"; in { services.openssh = { @@ -7,7 +8,8 @@ in settings.HostKey = keyFile; }; + # age will be activated, before impermanence mounts persistent files and directories. A workaround is to specify the persistent path for the key file age.identityPaths = [ - keyFile + persistentKeyFile ]; }