diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-05-02 01:06:19 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-05-02 01:06:19 +0200 |
commit | 95d4a7a0dc38282c994789883be509225fbc9fa4 (patch) | |
tree | c3a7eacaba43b6db314803386580da8d8bf73c8f | |
parent | 97953ca44b0438d6b366d610678906944ea63835 (diff) | |
download | Nix-95d4a7a0dc38282c994789883be509225fbc9fa4.tar.gz Nix-95d4a7a0dc38282c994789883be509225fbc9fa4.tar.zst Nix-95d4a7a0dc38282c994789883be509225fbc9fa4.zip |
Fix scripts environment and upgrade nixops
-rw-r--r-- | nix_path_env | 2 | ||||
-rwxr-xr-x | nixops/scripts/nixops_wrap | 11 | ||||
-rwxr-xr-x | nixops/scripts/pull_deployment | 5 | ||||
-rwxr-xr-x | nixops/scripts/push_deployment | 6 |
4 files changed, 11 insertions, 13 deletions
diff --git a/nix_path_env b/nix_path_env index bd976b6..0a57f10 100644 --- a/nix_path_env +++ b/nix_path_env | |||
@@ -4,7 +4,7 @@ if [ -z "$NIXOPS_DEPLOYMENT" ]; then | |||
4 | # This will automatically upgrade to latest version at each build | 4 | # This will automatically upgrade to latest version at each build |
5 | nixpkgs="https://nixos.org/channels/nixos-19.03/nixexprs.tar.xz" | 5 | nixpkgs="https://nixos.org/channels/nixos-19.03/nixexprs.tar.xz" |
6 | else | 6 | else |
7 | nixpkgs="https://releases.nixos.org/nixos/19.03/nixos-19.03.172361.cf3e277dd0b/nixexprs.tar.xz" | 7 | nixpkgs="https://releases.nixos.org/nixos/19.03/nixos-19.03.172396.d740b2ee855/nixexprs.tar.xz" |
8 | fi | 8 | fi |
9 | nixpkgsPrevious="$nixpkgs" | 9 | nixpkgsPrevious="$nixpkgs" |
10 | nixpkgsNext="$nixpkgs" | 10 | nixpkgsNext="$nixpkgs" |
diff --git a/nixops/scripts/nixops_wrap b/nixops/scripts/nixops_wrap index e50b246..12f661a 100755 --- a/nixops/scripts/nixops_wrap +++ b/nixops/scripts/nixops_wrap | |||
@@ -5,16 +5,18 @@ if [ -z "$NIXOPS_CONFIG_PASS_SUBTREE_PATH" ]; then | |||
5 | echo "Please set NIXOPS_CONFIG_PASS_SUBTREE_PATH to the password-store subtree path" | 5 | echo "Please set NIXOPS_CONFIG_PASS_SUBTREE_PATH to the password-store subtree path" |
6 | exit 1; | 6 | exit 1; |
7 | fi | 7 | fi |
8 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | ||
9 | export NIXOPS_STATE="$(dirname $DIR)/state/eldiron.nixops" | ||
10 | export NIXOPS_DEPLOYMENT="$DeploymentUuid" | ||
11 | source $(dirname $(dirname $DIR))/nix_path_env | ||
12 | nixops="$(nix-build --no-out-link -A nixops "$(dirname $(dirname $DIR))")/bin/nixops" | ||
8 | 13 | ||
9 | TEMP=$(mktemp -d /tmp/XXXXXX-nixops-files) | 14 | TEMP=$(mktemp -d /tmp/XXXXXX-nixops-files) |
10 | chmod go-rwx $TEMP | 15 | chmod go-rwx $TEMP |
11 | 16 | ||
12 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | ||
13 | source $(dirname $(dirname $DIR))/nix_path_env | ||
14 | # __noChroot: ssh-config-file requires relaxed | 17 | # __noChroot: ssh-config-file requires relaxed |
15 | export NIX_PATH="ssh-config-file=$(dirname $DIR)/ssh/config:$NIX_PATH" | 18 | export NIX_PATH="ssh-config-file=$(dirname $DIR)/ssh/config:$NIX_PATH" |
16 | 19 | ||
17 | nixops="$(nix-build --no-out-link -A nixops "$(dirname $(dirname $DIR))")/bin/nixops" | ||
18 | 20 | ||
19 | finish() { | 21 | finish() { |
20 | rm -rf "$TEMP" | 22 | rm -rf "$TEMP" |
@@ -23,9 +25,6 @@ finish() { | |||
23 | 25 | ||
24 | trap finish EXIT | 26 | trap finish EXIT |
25 | 27 | ||
26 | export NIXOPS_STATE="$(dirname $DIR)/state/eldiron.nixops" | ||
27 | export NIXOPS_DEPLOYMENT="$DeploymentUuid" | ||
28 | |||
29 | # pass cannot "just" list files in a directory without showing a tree :( | 28 | # pass cannot "just" list files in a directory without showing a tree :( |
30 | files=$(pass ls $NIXOPS_CONFIG_PASS_SUBTREE_PATH/Nixops/files | sed -e '1d' -e 's/^.* //') | 29 | files=$(pass ls $NIXOPS_CONFIG_PASS_SUBTREE_PATH/Nixops/files | sed -e '1d' -e 's/^.* //') |
31 | 30 | ||
diff --git a/nixops/scripts/pull_deployment b/nixops/scripts/pull_deployment index 2fc07bc..bc4a999 100755 --- a/nixops/scripts/pull_deployment +++ b/nixops/scripts/pull_deployment | |||
@@ -1,15 +1,16 @@ | |||
1 | #!/bin/bash | 1 | #!/bin/bash |
2 | 2 | ||
3 | DeploymentUuid="cef694f3-081d-11e9-b31f-0242ec186adf" | 3 | DeploymentUuid="cef694f3-081d-11e9-b31f-0242ec186adf" |
4 | |||
5 | if [ -z "$NIXOPS_CONFIG_PASS_SUBTREE_PATH" ]; then | 4 | if [ -z "$NIXOPS_CONFIG_PASS_SUBTREE_PATH" ]; then |
6 | echo "Please set NIXOPS_CONFIG_PASS_SUBTREE_PATH to the password-store subtree path" | 5 | echo "Please set NIXOPS_CONFIG_PASS_SUBTREE_PATH to the password-store subtree path" |
7 | exit 1; | 6 | exit 1; |
8 | fi | 7 | fi |
9 | |||
10 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | 8 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" |
9 | export NIXOPS_STATE="$(dirname $DIR)/state/eldiron.nixops" | ||
10 | export NIXOPS_DEPLOYMENT="$DeploymentUuid" | ||
11 | source $(dirname $(dirname $DIR))/nix_path_env | 11 | source $(dirname $(dirname $DIR))/nix_path_env |
12 | nixops="$(nix-build --no-out-link -A nixops "$(dirname $(dirname $DIR))")/bin/nixops" | 12 | nixops="$(nix-build --no-out-link -A nixops "$(dirname $(dirname $DIR))")/bin/nixops" |
13 | |||
13 | export NIXOPS_STATE="$(dirname $DIR)/state/eldiron.nixops" | 14 | export NIXOPS_STATE="$(dirname $DIR)/state/eldiron.nixops" |
14 | 15 | ||
15 | if $nixops info -d $DeploymentUuid 2>/dev/null >/dev/null; then | 16 | if $nixops info -d $DeploymentUuid 2>/dev/null >/dev/null; then |
diff --git a/nixops/scripts/push_deployment b/nixops/scripts/push_deployment index c8c34ee..067b665 100755 --- a/nixops/scripts/push_deployment +++ b/nixops/scripts/push_deployment | |||
@@ -1,16 +1,14 @@ | |||
1 | #!/bin/bash | 1 | #!/bin/bash |
2 | 2 | ||
3 | DeploymentUuid="cef694f3-081d-11e9-b31f-0242ec186adf" | 3 | DeploymentUuid="cef694f3-081d-11e9-b31f-0242ec186adf" |
4 | |||
5 | if [ -z "$NIXOPS_CONFIG_PASS_SUBTREE_PATH" ]; then | 4 | if [ -z "$NIXOPS_CONFIG_PASS_SUBTREE_PATH" ]; then |
6 | echo "Please set NIXOPS_CONFIG_PASS_SUBTREE_PATH to the password-store subtree path" | 5 | echo "Please set NIXOPS_CONFIG_PASS_SUBTREE_PATH to the password-store subtree path" |
7 | exit 1; | 6 | exit 1; |
8 | fi | 7 | fi |
9 | |||
10 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | 8 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" |
11 | source $(dirname $(dirname $DIR))/nix_path_env | ||
12 | nixops="$(nix-build --no-out-link -A nixops "$(dirname $(dirname $DIR))")/bin/nixops" | ||
13 | export NIXOPS_STATE="$(dirname $DIR)/state/eldiron.nixops" | 9 | export NIXOPS_STATE="$(dirname $DIR)/state/eldiron.nixops" |
14 | export NIXOPS_DEPLOYMENT="$DeploymentUuid" | 10 | export NIXOPS_DEPLOYMENT="$DeploymentUuid" |
11 | source $(dirname $(dirname $DIR))/nix_path_env | ||
12 | nixops="$(nix-build --no-out-link -A nixops "$(dirname $(dirname $DIR))")/bin/nixops" | ||
15 | 13 | ||
16 | $nixops export | pass insert -m $NIXOPS_CONFIG_PASS_SUBTREE_PATH/Nixops/Deployment | 14 | $nixops export | pass insert -m $NIXOPS_CONFIG_PASS_SUBTREE_PATH/Nixops/Deployment |