From c40778e6284b1fac9a557bff7dd47c4c84a6ae8a Mon Sep 17 00:00:00 2001 From: eyjhb Date: Wed, 21 Aug 2024 21:19:04 +0200 Subject: [PATCH] shared.state.ssh: specify hostkeys location instead of impermanence --- shared/applications/state/ssh.nix | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/shared/applications/state/ssh.nix b/shared/applications/state/ssh.nix index 653f470..b5a2da5 100644 --- a/shared/applications/state/ssh.nix +++ b/shared/applications/state/ssh.nix @@ -1,6 +1,10 @@ -{ - environment.persistence.root.files = [ - "/etc/ssh/ssh_host_ed25519_key" - "/etc/ssh/ssh_host_rsa_key" +{ config, ... }: + +let + statePath = config.environment.persistence.root.persistentStoragePath + "/etc/ssh"; +in { + services.openssh.hostKeys = [ + { path = statePath + "/ssh_host_rsa_key"; type = "rsa"; bits = 4096; } + { path = statePath + "/ssh_host_ed25519_key"; type = "ed25519"; } ]; }