aboutsummaryrefslogtreecommitdiff
path: root/nixops/scripts/setup
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2019-04-25 19:41:41 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2019-04-25 19:41:41 +0200
commitc79bb68270abd6e5a59e36bf09d64b2eb0d23fb8 (patch)
treecd86d2c91ebf20c045a55ed541a8cbccf8034d4a /nixops/scripts/setup
parent8db8e666707a0e51af9353c76c5863e1a5482ed5 (diff)
downloadNix-c79bb68270abd6e5a59e36bf09d64b2eb0d23fb8.tar.gz
Nix-c79bb68270abd6e5a59e36bf09d64b2eb0d23fb8.tar.zst
Nix-c79bb68270abd6e5a59e36bf09d64b2eb0d23fb8.zip
Add makefile and remove nixops dependency
Diffstat (limited to 'nixops/scripts/setup')
-rwxr-xr-xnixops/scripts/setup27
1 files changed, 4 insertions, 23 deletions
diff --git a/nixops/scripts/setup b/nixops/scripts/setup
index 4a76d35..cfa8d64 100755
--- a/nixops/scripts/setup
+++ b/nixops/scripts/setup
@@ -134,31 +134,12 @@ if nix show-config --json | jq -e '.sandbox.value == "true"' >/dev/null; then
134 exit 1 134 exit 1
135fi 135fi
136 136
137if ! which nixops 2>/dev/null >/dev/null; then
138 cat <<-EOF
139 nixops is needed:
140 > nix-env -i nixops
141 If it fails, please check that $HOME/.nix-profile/bin is in your PATH.
142 Continue? [y/N]
143 EOF
144 read y
145 if [ "$y" = "y" -o "$y" = "Y" ]; then
146 nix-env -i nixops
147 if ! which nixops 2>/dev/null >/dev/null; then
148 echo "Installation failed, please check that $HOME/.nix-profile/bin is in your path."
149 exit 1
150 fi
151 else
152 echo "Aborting"
153 exit 1
154 fi
155fi
156
157DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" 137DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
138nixops="$(nix-build --no-out-link -A nixops "$(dirname $(dirname $DIR))")/bin/nixops"
158export NIXOPS_STATE="$(dirname $DIR)/state/eldiron.nixops" 139export NIXOPS_STATE="$(dirname $DIR)/state/eldiron.nixops"
159export NIXOPS_DEPLOYMENT="$DeploymentUuid" 140export NIXOPS_DEPLOYMENT="$DeploymentUuid"
160 141
161if ! nixops info 2>/dev/null >/dev/null; then 142if ! $nixops info 2>/dev/null >/dev/null; then
162 cat <<-EOF 143 cat <<-EOF
163 Importing deployment file into nixops: 144 Importing deployment file into nixops:
164 Continue? [y/N] 145 Continue? [y/N]
@@ -166,9 +147,9 @@ if ! nixops info 2>/dev/null >/dev/null; then
166 read y 147 read y
167 if [ "$y" = "y" -o "$y" = "Y" ]; then 148 if [ "$y" = "y" -o "$y" = "Y" ]; then
168 deployment=$(pass show $NIXOPS_CONFIG_PASS_SUBTREE_PATH/Nixops/Deployment) 149 deployment=$(pass show $NIXOPS_CONFIG_PASS_SUBTREE_PATH/Nixops/Deployment)
169 echo "$deployment" | nixops import 150 echo "$deployment" | $nixops import
170 151
171 nixops modify "$(dirname $DIR)/eldiron.nix" 152 $nixops modify "$(dirname $DIR)/eldiron.nix"
172 else 153 else
173 echo "Aborting" 154 echo "Aborting"
174 exit 1 155 exit 1