diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2020-08-27 23:53:36 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2020-08-27 23:53:36 +0200 |
commit | 1052bfda27ad0607cd4dc5dc91e2d8e8220c30c7 (patch) | |
tree | bb6335465082ec87ac6503f0fccecda7d89ad958 /nixops/scripts/with_env | |
parent | 7e214bf9e1bb58b83317db95dfb70dbeac0a4e28 (diff) | |
download | Nix-1052bfda27ad0607cd4dc5dc91e2d8e8220c30c7.tar.gz Nix-1052bfda27ad0607cd4dc5dc91e2d8e8220c30c7.tar.zst Nix-1052bfda27ad0607cd4dc5dc91e2d8e8220c30c7.zip |
Simplify management of secrets in nixops
Diffstat (limited to 'nixops/scripts/with_env')
-rwxr-xr-x | nixops/scripts/with_env | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/nixops/scripts/with_env b/nixops/scripts/with_env index dd0fecb..26e74b5 100755 --- a/nixops/scripts/with_env +++ b/nixops/scripts/with_env | |||
@@ -5,11 +5,6 @@ if [ -z "$NIXOPS" ]; then | |||
5 | exit 1; | 5 | exit 1; |
6 | fi | 6 | fi |
7 | 7 | ||
8 | if [ -z "$NIXOPS_CONFIG_PASS_SUBTREE_PATH" ]; then | ||
9 | echo "Please set NIXOPS_CONFIG_PASS_SUBTREE_PATH to the password-store subtree path" | ||
10 | exit 1; | ||
11 | fi | ||
12 | |||
13 | TEMP=$(mktemp -d /tmp/XXXXXX-nixops-files) | 8 | TEMP=$(mktemp -d /tmp/XXXXXX-nixops-files) |
14 | chmod go-rwx $TEMP | 9 | chmod go-rwx $TEMP |
15 | 10 | ||
@@ -21,10 +16,10 @@ finish() { | |||
21 | trap finish EXIT | 16 | trap finish EXIT |
22 | 17 | ||
23 | # pass cannot "just" list files in a directory without showing a tree :( | 18 | # pass cannot "just" list files in a directory without showing a tree :( |
24 | files=$(pass ls $NIXOPS_CONFIG_PASS_SUBTREE_PATH/Nixops/files | sed -e '1d' -e 's/^.* //') | 19 | files=$(pass ls Nixops/files | sed -e '1d' -e 's/^.* //') |
25 | 20 | ||
26 | for file in $files; do | 21 | for file in $files; do |
27 | pass show "$NIXOPS_CONFIG_PASS_SUBTREE_PATH/Nixops/files/$file" > $TEMP/$file | 22 | pass show "Nixops/files/$file" > $TEMP/$file |
28 | done | 23 | done |
29 | $NIXOPS set-args --argstr privateFiles "$TEMP" | 24 | $NIXOPS set-args --argstr privateFiles "$TEMP" |
30 | 25 | ||