diff options
Diffstat (limited to 'nixops/scripts')
-rwxr-xr-x | nixops/scripts/setup | 16 | ||||
-rwxr-xr-x | nixops/scripts/with_env | 6 |
2 files changed, 4 insertions, 18 deletions
diff --git a/nixops/scripts/setup b/nixops/scripts/setup index 22f43ce..e161e43 100755 --- a/nixops/scripts/setup +++ b/nixops/scripts/setup | |||
@@ -2,8 +2,6 @@ | |||
2 | 2 | ||
3 | set -euo pipefail | 3 | set -euo pipefail |
4 | 4 | ||
5 | MAKEFILE_DIR="$( cd "$( dirname $( dirname "${BASH_SOURCE[0]}" ))" >/dev/null 2>&1 && pwd )" | ||
6 | |||
7 | if ! which nix 2>/dev/null >/dev/null; then | 5 | if ! which nix 2>/dev/null >/dev/null; then |
8 | cat <<-EOF | 6 | cat <<-EOF |
9 | nix is needed, please install it: | 7 | nix is needed, please install it: |
@@ -62,20 +60,6 @@ if nix show-config --json | jq -e '.sandbox.value == "true"' >/dev/null; then | |||
62 | read y | 60 | read y |
63 | fi | 61 | fi |
64 | 62 | ||
65 | if ! make -C $MAKEFILE_DIR deployment_is_set 2>/dev/null >/dev/null; then | ||
66 | cat <<-EOF | ||
67 | Importing deployment file into nixops: | ||
68 | Continue? [y/N] | ||
69 | EOF | ||
70 | read y | ||
71 | if [ "$y" = "y" -o "$y" = "Y" ]; then | ||
72 | make -C $MAKEFILE_DIR pull_deployment | ||
73 | else | ||
74 | echo "Aborting" | ||
75 | exit 1 | ||
76 | fi | ||
77 | fi | ||
78 | |||
79 | cat <<-EOF | 63 | cat <<-EOF |
80 | All set up. | 64 | All set up. |
81 | Please make sure you’re using make commands when deploying | 65 | Please make sure you’re using make commands when deploying |
diff --git a/nixops/scripts/with_env b/nixops/scripts/with_env index 9882f78..f8e5537 100755 --- a/nixops/scripts/with_env +++ b/nixops/scripts/with_env | |||
@@ -5,12 +5,12 @@ if [ -z "$NIXOPS_ENV_LOADED" ]; then | |||
5 | exit 1; | 5 | exit 1; |
6 | fi | 6 | fi |
7 | 7 | ||
8 | umask 0077 | ||
8 | TEMP=$(mktemp -d /tmp/XXXXXX-nixops-files) | 9 | TEMP=$(mktemp -d /tmp/XXXXXX-nixops-files) |
9 | chmod go-rwx $TEMP | 10 | chmod go-rwx $TEMP |
10 | 11 | ||
11 | finish() { | 12 | finish() { |
12 | rm -rf "$TEMP" | 13 | rm -rf "$TEMP" |
13 | nixops set-args --unset privateFiles | ||
14 | } | 14 | } |
15 | 15 | ||
16 | trap finish EXIT | 16 | trap finish EXIT |
@@ -21,6 +21,8 @@ files=$(pass ls Nixops/files | sed -e '1d' -e 's/^.* //') | |||
21 | for file in $files; do | 21 | for file in $files; do |
22 | pass show "Nixops/files/$file" > $TEMP/$file | 22 | pass show "Nixops/files/$file" > $TEMP/$file |
23 | done | 23 | done |
24 | nixops set-args --argstr privateFiles "$TEMP" | 24 | |
25 | export NIX_PATH="privateFiles=$TEMP:$NIX_PATH" | ||
26 | export SSH_IDENTITY_FILE="$TEMP/id_ed25519" | ||
25 | 27 | ||
26 | "$@" | 28 | "$@" |