Add support for SSH key cmd

This commit is contained in:
uncenter 2026-03-09 14:57:07 -05:00
parent df977b7f76
commit b2676a047c
No known key found for this signature in database
6 changed files with 42 additions and 1 deletions

View file

@ -350,6 +350,16 @@ in
the native ssh key support in age and requires no conversion.
'';
};
sshKeyCmd = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = null;
description = ''
Command that outputs a (non-password protected) ssh private key that will be used by age for sops decryption.
Uses native ssh key support in age and requires no conversion.
'';
};
sshKeyPaths = lib.mkOption {
type = lib.types.listOf lib.types.path;
@ -421,6 +431,7 @@ in
|| cfg.gnupg.sshKeyPaths != [ ]
|| cfg.age.keyFile != null
|| cfg.age.sshKeyFile != null
|| cfg.age.sshKeyCmd != null
|| cfg.age.sshKeyPaths != [ ];
message = "No key source configured for sops. Either set services.openssh.enable or set sops.age.keyFile or sops.gnupg.home";
}

View file

@ -41,6 +41,7 @@ else
sshKeyPaths = cfg.gnupg.sshKeyPaths;
ageKeyFile = cfg.age.keyFile;
ageSshKeyFile = cfg.age.sshKeyFile;
ageSshKeyCmd = cfg.age.ageSshKeyCmd;
ageSshKeyPaths = cfg.age.sshKeyPaths;
useTmpfs = cfg.useTmpfs;
placeholderBySecretName = cfg.placeholder;