blob: 24b838181e22f1c2d5e27d81fad7f02508f61e63 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
#!/bin/bash
DeploymentUuid="cef694f3-081d-11e9-b31f-0242ec186adf"
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
TEMP=$(mktemp /tmp/XXXXXX-environment.nix)
chmod go-rwx $TEMP
finish() {
rm -f "$TEMP"
nixops set-args --unset environment
}
trap finish EXIT
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
export NIXOPS_STATE="$(dirname $DIR)/state/eldiron.nixops"
export NIXOPS_DEPLOYMENT="$DeploymentUuid"
pass show "$NIXOPS_CONFIG_PASS_SUBTREE_PATH/NixConfig" >> $TEMP
nixops set-args --argstr environment "$TEMP"
export NIX_PATH="ssh-config-file=$(dirname $DIR)/ssh/config:nixpkgs=$HOME/.nix-defexpr/channels/immaeNixpkgs"
nixops "$@"
|