From 96b7e4f9eb4db2763db2699322fa2a544184d1eb Mon Sep 17 00:00:00 2001 From: codgician <15964984+codgician@users.noreply.github.com> Date: Mon, 13 Jan 2025 11:59:48 +0800 Subject: [PATCH] contrib: improve readability of age.identityPaths default value --- modules/age.nix | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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 = ''