diff options
Diffstat (limited to 'modules/persistence.nix')
-rw-r--r-- | modules/persistence.nix | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/modules/persistence.nix b/modules/persistence.nix index 3131d61..989bed0 100644 --- a/modules/persistence.nix +++ b/modules/persistence.nix @@ -1,4 +1,4 @@ -{ config, lib, ... }: +{ config, inputs, lib, ... }: with lib; @@ -6,6 +6,10 @@ let cfg = config.modules.persistence; in { + imports = [ + inputs.impermanence.nixosModules.impermanence + ]; + options.modules.persistence = { enable = mkEnableOption "impermanence persistence"; @@ -17,6 +21,8 @@ in ''; }; + setupSshHostKeys = mkEnableOption "configure persistence for OpenSSH Host keys"; + directories = mkOption { type = types.listOf types.str; default = [ ]; @@ -28,7 +34,7 @@ in environment.persistence.${cfg.storagePath}.directories = cfg.directories; - services.openssh.hostKeys = [ + services.openssh.hostKeys = mkIf cfg.setupSshHostKeys [ { path = "${cfg.storagePath}/ssh/ssh_host_ed25519_key"; type = "ed25519"; |