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 47a0c24
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions modules/age.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ with lib; let

ageBin = config.age.ageBin;

pluginPaths = concatMapStrings (x: ":" + "${x}/bin") config.age.pluginPackages;

users = config.users.users;

mountCommand =
Expand Down Expand Up @@ -63,6 +65,7 @@ with lib; let

installSecret = secretType: ''
${setTruePath secretType}
export PATH="${pkgs.gnugrep}/bin:${pkgs.coreutils}/bin:@out@/sw/bin:/usr/bin:/bin:/usr/sbin:/sbin${pluginPaths}"
echo "decrypting '${secretType.file}' to '$_truePath'..."
TMP_FILE="$_truePath.tmp"
Expand Down Expand Up @@ -187,6 +190,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 47a0c24

Please sign in to comment.