aboutsummaryrefslogtreecommitdiff
path: root/nixops/scripts/nixops_wrap
blob: c23d3088f0f269af41f10913e1a1200b3a2665ef (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash

if [ -z "$NIXOPS_CONFIG_PASS_PATH" ]; then
  echo "Please set NIXOPS_CONFIG_PASS_PATH to the password-store environment file 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

pass show "$NIXOPS_CONFIG_PASS_PATH" >> $TEMP
nixops set-args --argstr environment "$TEMP"

nixops "$@"