diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-02-21 22:45:23 +0100 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-02-21 22:45:23 +0100 |
commit | 9690acd9e5ff473fdc88ef13bcc98bb698cfb269 (patch) | |
tree | 2fa1019fd6fdb6b53802c672ce6ffdc664c90aa7 /nixops/scripts/nixops_wrap | |
parent | 4795e024ca103932d419e133f02dedbb6ab46a8b (diff) | |
download | Nix-9690acd9e5ff473fdc88ef13bcc98bb698cfb269.tar.gz Nix-9690acd9e5ff473fdc88ef13bcc98bb698cfb269.tar.zst Nix-9690acd9e5ff473fdc88ef13bcc98bb698cfb269.zip |
Move private files in a better layout
Diffstat (limited to 'nixops/scripts/nixops_wrap')
-rwxr-xr-x | nixops/scripts/nixops_wrap | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/nixops/scripts/nixops_wrap b/nixops/scripts/nixops_wrap index 24b8381..561bf6e 100755 --- a/nixops/scripts/nixops_wrap +++ b/nixops/scripts/nixops_wrap | |||
@@ -6,12 +6,12 @@ if [ -z "$NIXOPS_CONFIG_PASS_SUBTREE_PATH" ]; then | |||
6 | exit 1; | 6 | exit 1; |
7 | fi | 7 | fi |
8 | 8 | ||
9 | TEMP=$(mktemp /tmp/XXXXXX-environment.nix) | 9 | TEMP=$(mktemp -d /tmp/XXXXXX-nixops-files) |
10 | chmod go-rwx $TEMP | 10 | chmod go-rwx $TEMP |
11 | 11 | ||
12 | finish() { | 12 | finish() { |
13 | rm -f "$TEMP" | 13 | rm -rf "$TEMP" |
14 | nixops set-args --unset environment | 14 | nixops set-args --unset privateFiles |
15 | } | 15 | } |
16 | 16 | ||
17 | trap finish EXIT | 17 | trap finish EXIT |
@@ -20,8 +20,13 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | |||
20 | export NIXOPS_STATE="$(dirname $DIR)/state/eldiron.nixops" | 20 | export NIXOPS_STATE="$(dirname $DIR)/state/eldiron.nixops" |
21 | export NIXOPS_DEPLOYMENT="$DeploymentUuid" | 21 | export NIXOPS_DEPLOYMENT="$DeploymentUuid" |
22 | 22 | ||
23 | pass show "$NIXOPS_CONFIG_PASS_SUBTREE_PATH/NixConfig" >> $TEMP | 23 | # pass cannot "just" list files in a directory without showing a tree :( |
24 | nixops set-args --argstr environment "$TEMP" | 24 | files=$(pass ls $NIXOPS_CONFIG_PASS_SUBTREE_PATH/Nixops/files | sed -e '1d' -e 's/^.* //') |
25 | |||
26 | for file in $files; do | ||
27 | pass show "$NIXOPS_CONFIG_PASS_SUBTREE_PATH/Nixops/files/$file" > $TEMP/$file | ||
28 | done | ||
29 | nixops set-args --argstr privateFiles "$TEMP" | ||
25 | 30 | ||
26 | export NIX_PATH="ssh-config-file=$(dirname $DIR)/ssh/config:nixpkgs=$HOME/.nix-defexpr/channels/immaeNixpkgs" | 31 | export NIX_PATH="ssh-config-file=$(dirname $DIR)/ssh/config:nixpkgs=$HOME/.nix-defexpr/channels/immaeNixpkgs" |
27 | nixops "$@" | 32 | nixops "$@" |