X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=nixops%2Fscripts%2Fwith_env;fp=nixops%2Fscripts%2Fnixops_wrap;h=a442ced2091ed8fe1c643f8fccd85cd930188c8a;hb=4506dbe51901f66406a02042b2097b3b3856e8a6;hp=28aa917fca212d8b9e12008e03ba10dee0327c75;hpb=2232653330cedd11ac2aa64bdac994137cb26e80;p=perso%2FImmae%2FConfig%2FNix.git diff --git a/nixops/scripts/nixops_wrap b/nixops/scripts/with_env similarity index 58% rename from nixops/scripts/nixops_wrap rename to nixops/scripts/with_env index 28aa917..a442ced 100755 --- a/nixops/scripts/nixops_wrap +++ b/nixops/scripts/with_env @@ -1,21 +1,21 @@ #!/bin/bash -DeploymentUuid="cef694f3-081d-11e9-b31f-0242ec186adf" +if [ -z "$NIXOPS" ]; then + echo "Please set NIXOPS to the nixops command" + exit 1; +fi + if [ -z "$NIXOPS_CONFIG_PASS_SUBTREE_PATH" ]; then echo "Please set NIXOPS_CONFIG_PASS_SUBTREE_PATH to the password-store subtree path" exit 1; fi -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -export NIXOPS_STATE="$(dirname $DIR)/state/eldiron.nixops" -export NIXOPS_DEPLOYMENT="$DeploymentUuid" -source $(dirname $(dirname $DIR))/scripts/nix_env TEMP=$(mktemp -d /tmp/XXXXXX-nixops-files) chmod go-rwx $TEMP finish() { rm -rf "$TEMP" - nixops_custom set-args --unset privateFiles + $NIXOPS set-args --unset privateFiles } trap finish EXIT @@ -26,6 +26,6 @@ files=$(pass ls $NIXOPS_CONFIG_PASS_SUBTREE_PATH/Nixops/files | sed -e '1d' -e ' for file in $files; do pass show "$NIXOPS_CONFIG_PASS_SUBTREE_PATH/Nixops/files/$file" > $TEMP/$file done -nixops_custom set-args --argstr privateFiles "$TEMP" +$NIXOPS set-args --argstr privateFiles "$TEMP" -nixops_custom "$@" +"$@"