feat: allow .nix.age files to contain functions or bare attrs

This commit is contained in:
oddlama 2023-03-15 02:29:14 +01:00
parent 5bf0935eb2
commit 3111408f7d
No known key found for this signature in database
GPG key ID: 14EFE510775FE39A
6 changed files with 37 additions and 30 deletions

View file

@ -22,7 +22,7 @@
in
lenContent >= lenSuffix && builtins.substring (lenContent - lenSuffix) lenContent content == suffix;
in {
rageImportDecrypt = identities: nixFile:
rageImportEncrypted = identities: nixFile:
assert assertMsg (builtins.isPath nixFile) "The file to decrypt must be given as a path to prevent impurity.";
assert assertMsg (hasSuffix ".nix.age" nixFile) "The content of the decrypted file must be a nix expression and should therefore end in .nix.age";
exec (["rage" "-d"] ++ (builtins.concatMap (x: ["-i" x]) identities) ++ [nixFile]);