Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion modules/age.nix
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,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}"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
LANG=${config.i18n.defaultLocale or "C"} PATH=${lib.makeBinPath cfg.pluginPackages} ${ageBin} --decrypt "''${IDENTITIES[@]}" -o "$TMP_FILE" "${secretType.file}"
LANG=${config.i18n.defaultLocale or "C"} PATH=${lib.makeBinPath cfg.plugins} ${ageBin} --decrypt "''${IDENTITIES[@]}" -o "$TMP_FILE" "${secretType.file}"

)
chmod ${secretType.mode} "$TMP_FILE"
mv -f "$TMP_FILE" "$_truePath"
Expand Down Expand Up @@ -198,6 +198,13 @@ in {
The age executable to use.
'';
};
pluginPackages = mkOption {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking perhaps it would be nicer to name this path, similar to systemd.services.<name>.path. On the other hand, the name pluginPackages communicates more intent and I believe is more discoverable. Thoughts? :)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think pluginPackages or just plugins are preferable: intent is clearer, as you said, and it is more discoverable by users who might not know age plugins are just executables in PATH.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree plugins should be used in this case.

Suggested change
pluginPackages = mkOption {
plugins = 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