diff --git a/modules/age.nix b/modules/age.nix index 7fecfe1..a9064e6 100644 --- a/modules/age.nix +++ b/modules/age.nix @@ -228,22 +228,22 @@ in { identityPaths = mkOption { type = types.listOf types.path; default = - if ((config.services.openssh.enable or false) == true && config.services.openssh ? hostKeys) - then map (e: e.path) (lib.filter (e: e.type == "rsa" || e.type == "ed25519") config.services.openssh.hostKeys) - else if isDarwin + if isDarwin then [ "/etc/ssh/ssh_host_ed25519_key" "/etc/ssh/ssh_host_rsa_key" ] + else if (config.services.openssh.enable or false) + then map (e: e.path) (lib.filter (e: e.type == "rsa" || e.type == "ed25519") config.services.openssh.hostKeys) else []; defaultText = literalExpression '' - if ((config.services.openssh.enable or false) == true && config.services.openssh?hostKeys) - then map (e: e.path) (lib.filter (e: e.type == "rsa" || e.type == "ed25519") config.services.openssh.hostKeys) - else if isDarwin + if isDarwin then [ "/etc/ssh/ssh_host_ed25519_key" "/etc/ssh/ssh_host_rsa_key" ] + else if (config.services.openssh.enable or false) + then map (e: e.path) (lib.filter (e: e.type == "rsa" || e.type == "ed25519") config.services.openssh.hostKeys) else []; ''; description = ''