1
0
Fork 0
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:
Janne Heß 2021-09-30 15:28:39 +02:00
parent 5db02f2939
commit 4cebc08062
No known key found for this signature in database
GPG key ID: 69165158F05265DF
2 changed files with 6 additions and 1 deletions

View file

@ -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.

View file

@ -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;
};
};
};