contrib: improve readability of age.identityPaths default value

This commit is contained in:
codgician 2025-01-13 11:59:48 +08:00
parent 989ade2850
commit 96b7e4f9eb
No known key found for this signature in database

View file

@ -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 = ''