From b78fa2c4c2715d9bfe0d98cd699495d5a504722a Mon Sep 17 00:00:00 2001 From: Roy Dumblauskas Date: Sun, 27 Apr 2025 23:07:22 -0500 Subject: [PATCH] working config, persist host_keys --- nixos/configuration.nix | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/nixos/configuration.nix b/nixos/configuration.nix index 6a51678..d6ccec2 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -90,7 +90,7 @@ in }; # Rollback root on reboot - boot.initrd.postDeviceCommands = lib.mkAfter '' + boot.initrd.postMountCommands = lib.mkAfter '' zfs rollback -r zroot/root@blank ''; @@ -185,7 +185,20 @@ in # List services that you want to enable: # Enable the OpenSSH daemon. - services.openssh.enable = true; + services.openssh = { + enable = true; + hostKeys = [ + { + type = "ed25519"; + path = "/persist/etc/ssh/ssh_host_ed25519_key"; + } + { + type = "rsa"; + bits = 4096; + path = "/persist/etc/ssh/ssh_host_rsa_key"; + } + ]; + }; # Copy the NixOS configuration file and link it from the resulting system # (/run/current-system/configuration.nix). This is useful in case you