mirror of
https://github.com/Mic92/sops-nix.git
synced 2026-05-13 16:38:45 +08:00
feat(nixos): add age key generation args option
This commit is contained in:
parent
d7cbc61787
commit
1721fd4324
2 changed files with 61 additions and 1 deletions
|
|
@ -361,6 +361,15 @@ in
|
|||
'';
|
||||
};
|
||||
|
||||
extraGenerateKeyArgs = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
default = [ ];
|
||||
example = [ "-pq" ];
|
||||
description = ''
|
||||
List of arguments to use when generating the age key.
|
||||
'';
|
||||
};
|
||||
|
||||
sshKeyPaths = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.path;
|
||||
default = defaultImportKeys "ed25519";
|
||||
|
|
@ -511,7 +520,7 @@ in
|
|||
echo generating machine-specific age key...
|
||||
mkdir -p $(dirname ${escapedKeyFile})
|
||||
# age-keygen sets 0600 by default, no need to chmod.
|
||||
${pkgs.age}/bin/age-keygen -o ${escapedKeyFile}
|
||||
${pkgs.age}/bin/age-keygen -o ${escapedKeyFile} ${lib.join " " cfg.age.extraGenerateKeyArgs}
|
||||
fi
|
||||
''
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue