mirror of
https://github.com/Mic92/sops-nix.git
synced 2025-03-05 08:07:16 +00:00
Fix age key generation and test it
This commit is contained in:
parent
5db02f2939
commit
4cebc08062
2 changed files with 6 additions and 1 deletions
|
@ -212,7 +212,7 @@ in {
|
|||
'';
|
||||
|
||||
system.activationScripts.generate-age-key = (mkIf cfg.age.generateKey) (stringAfter [] ''
|
||||
if [[ ! -f "${cfg.age.keyFile}" ]]; then;
|
||||
if [[ ! -f '${cfg.age.keyFile}' ]]; then
|
||||
echo generating machine-specific age key...
|
||||
mkdir -p $(dirname ${cfg.age.keyFile})
|
||||
# age-keygen sets 0600 by default, no need to chmod.
|
||||
|
|
|
@ -55,6 +55,11 @@
|
|||
sops = {
|
||||
defaultSopsFile = ./test-assets/secrets.yaml;
|
||||
secrets.test_key = {};
|
||||
# Generate a key and append it to make sure it appending doesn't break anything
|
||||
age = {
|
||||
keyFile = "/tmp/testkey";
|
||||
generateKey = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue