aboutsummaryrefslogtreecommitdiff
path: root/nixops/scripts/nixops_wrap
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2019-02-21 22:45:23 +0100
committerIsmaël Bouya <ismael.bouya@normalesup.org>2019-02-21 22:45:23 +0100
commit9690acd9e5ff473fdc88ef13bcc98bb698cfb269 (patch)
tree2fa1019fd6fdb6b53802c672ce6ffdc664c90aa7 /nixops/scripts/nixops_wrap
parent4795e024ca103932d419e133f02dedbb6ab46a8b (diff)
downloadNix-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-xnixops/scripts/nixops_wrap15
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;
7fi 7fi
8 8
9TEMP=$(mktemp /tmp/XXXXXX-environment.nix) 9TEMP=$(mktemp -d /tmp/XXXXXX-nixops-files)
10chmod go-rwx $TEMP 10chmod go-rwx $TEMP
11 11
12finish() { 12finish() {
13 rm -f "$TEMP" 13 rm -rf "$TEMP"
14 nixops set-args --unset environment 14 nixops set-args --unset privateFiles
15} 15}
16 16
17trap finish EXIT 17trap finish EXIT
@@ -20,8 +20,13 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
20export NIXOPS_STATE="$(dirname $DIR)/state/eldiron.nixops" 20export NIXOPS_STATE="$(dirname $DIR)/state/eldiron.nixops"
21export NIXOPS_DEPLOYMENT="$DeploymentUuid" 21export NIXOPS_DEPLOYMENT="$DeploymentUuid"
22 22
23pass show "$NIXOPS_CONFIG_PASS_SUBTREE_PATH/NixConfig" >> $TEMP 23# pass cannot "just" list files in a directory without showing a tree :(
24nixops set-args --argstr environment "$TEMP" 24files=$(pass ls $NIXOPS_CONFIG_PASS_SUBTREE_PATH/Nixops/files | sed -e '1d' -e 's/^.* //')
25
26for file in $files; do
27 pass show "$NIXOPS_CONFIG_PASS_SUBTREE_PATH/Nixops/files/$file" > $TEMP/$file
28done
29nixops set-args --argstr privateFiles "$TEMP"
25 30
26export NIX_PATH="ssh-config-file=$(dirname $DIR)/ssh/config:nixpkgs=$HOME/.nix-defexpr/channels/immaeNixpkgs" 31export NIX_PATH="ssh-config-file=$(dirname $DIR)/ssh/config:nixpkgs=$HOME/.nix-defexpr/channels/immaeNixpkgs"
27nixops "$@" 32nixops "$@"