diff options
Diffstat (limited to 'nixops/scripts')
-rwxr-xr-x | nixops/scripts/setup | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/nixops/scripts/setup b/nixops/scripts/setup index e161e43..9bdb8df 100755 --- a/nixops/scripts/setup +++ b/nixops/scripts/setup | |||
@@ -1,4 +1,4 @@ | |||
1 | #!/bin/bash | 1 | #!/usr/bin/env bash |
2 | 2 | ||
3 | set -euo pipefail | 3 | set -euo pipefail |
4 | 4 | ||
@@ -18,6 +18,32 @@ if [ "${NIX_STORE:-/nix/store}" != "/nix/store" ]; then | |||
18 | exit 1 | 18 | exit 1 |
19 | fi | 19 | fi |
20 | 20 | ||
21 | if ! which direnv 2>/dev/null >/dev/null; then | ||
22 | cat <<-EOF | ||
23 | direnv is needed, please install it | ||
24 | EOF | ||
25 | exit 1 | ||
26 | fi | ||
27 | |||
28 | if [ -z "$NIXOPS_ENV_LOADED" ]; then | ||
29 | cat <<-EOF | ||
30 | direnv environment needs to be loaded | ||
31 | EOF | ||
32 | exit 1 | ||
33 | fi | ||
34 | |||
35 | if [ "$(git config --get include.path)" != "../.gitconfig" ]; then | ||
36 | cat <<-EOF | ||
37 | it is recommended to include the .gitconfig file into (local) git configuration: | ||
38 | git config --local include.path '../.gitconfig' | ||
39 | Run this command? [y/N] | ||
40 | EOF | ||
41 | read y | ||
42 | if [ "$y" = "y" -o "$y" = "Y" ]; then | ||
43 | git config --local include.path '../.gitconfig' | ||
44 | fi | ||
45 | fi | ||
46 | |||
21 | gpg_keys=$(pass ls Nixops/GPGKeys | sed -e "1d" | cut -d" " -f2) | 47 | gpg_keys=$(pass ls Nixops/GPGKeys | sed -e "1d" | cut -d" " -f2) |
22 | for key in $gpg_keys; do | 48 | for key in $gpg_keys; do |
23 | content=$(pass show Nixops/GPGKeys/$key) | 49 | content=$(pass show Nixops/GPGKeys/$key) |