-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: patch agenix to support functions
Signed-off-by: Reputable2722 <[email protected]>
- Loading branch information
1 parent
0e13dff
commit 01b3039
Showing
4 changed files
with
56 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- a/pkgs/agenix.sh | ||
+++ b/pkgs/agenix.sh | ||
@@ -115,7 +115,7 @@ function cleanup { | ||
trap "cleanup" 0 2 3 15 | ||
|
||
function keys { | ||
- (@nixInstantiate@ --json --eval --strict -E "(let rules = import $RULES; in rules.\"$1\".publicKeys)" | @jqBin@ -r .[]) || exit 1 | ||
+ (@nixInstantiate@ --json --eval --strict -E "(let _rules = import $RULES; rules = if (builtins.isFunction _rules) then _rules {} else _rules; in rules.\"$1\".publicKeys)" | @jqBin@ -r .[]) || exit 1 | ||
} | ||
|
||
function decrypt { | ||
@@ -189,7 +189,7 @@ function edit { | ||
} | ||
|
||
function rekey { | ||
- FILES=$( (@nixInstantiate@ --json --eval -E "(let rules = import $RULES; in builtins.attrNames rules)" | @jqBin@ -r .[]) || exit 1) | ||
+ FILES=$( (@nixInstantiate@ --json --eval -E "(let _rules = import $RULES; rules = if (builtins.isFunction _rules) then _rules {} else _rules; in builtins.attrNames rules)" | @jqBin@ -r .[]) || exit 1) | ||
|
||
for FILE in $FILES | ||
do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters