mirror of
https://github.com/Mic92/sops-nix.git
synced 2026-05-09 09:12:28 +08:00
feat(home-manager): add age key generation args option
This commit is contained in:
parent
d2e8438d58
commit
d7cbc61787
2 changed files with 11 additions and 1 deletions
|
|
@ -9,6 +9,7 @@
|
|||
home.enableNixpkgsReleaseCheck = false;
|
||||
|
||||
sops.age.generateKey = true;
|
||||
sops.age.extraGenerateKeyArgs = [ "-pq" ];
|
||||
sops.age.keyFile = "${config.home.homeDirectory}/.age-key.txt";
|
||||
sops.secrets.test_key = { };
|
||||
sops.templates."template.toml".content = ''
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ let
|
|||
echo generating machine-specific age key...
|
||||
${pkgs.coreutils}/bin/mkdir -p $(${pkgs.coreutils}/bin/dirname ${escapedAgeKeyFile})
|
||||
# age-keygen sets 0600 by default, no need to chmod.
|
||||
${pkgs.age}/bin/age-keygen -o ${escapedAgeKeyFile}
|
||||
${pkgs.age}/bin/age-keygen -o ${escapedAgeKeyFile} ${lib.join " " cfg.age.extraGenerateKeyArgs}
|
||||
fi
|
||||
''
|
||||
+ ''
|
||||
|
|
@ -267,6 +267,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 = [ ];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue