Skip to content

Commit

Permalink
Add support for age plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
koenw committed May 19, 2023
1 parent db5637d commit 20cfd87
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion modules/age.nix
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ with lib; let
umask u=r,g=,o=
test -f "${secretType.file}" || echo '[agenix] WARNING: encrypted file ${secretType.file} does not exist!'
test -d "$(dirname "$TMP_FILE")" || echo "[agenix] WARNING: $(dirname "$TMP_FILE") does not exist!"
LANG=${config.i18n.defaultLocale or "C"} ${ageBin} --decrypt "''${IDENTITIES[@]}" -o "$TMP_FILE" "${secretType.file}"
LANG=${config.i18n.defaultLocale or "C"} PATH=${lib.makeBinPath cfg.pluginPackages} ${ageBin} --decrypt "''${IDENTITIES[@]}" -o "$TMP_FILE" "${secretType.file}"
)
chmod ${secretType.mode} "$TMP_FILE"
mv -f "$TMP_FILE" "$_truePath"
Expand Down Expand Up @@ -187,6 +187,13 @@ in {
The age executable to use.
'';
};
pluginPackages = mkOption {
type = types.listOf types.package;
default = [];
description = ''
List of age plugins that should be available in $PATH during the build.
'';
};
secrets = mkOption {
type = types.attrsOf secretType;
default = {};
Expand Down

0 comments on commit 20cfd87

Please sign in to comment.