]> git.immae.eu Git - perso/Immae/Config/Nix.git/blame - nixops/scripts/nixops_wrap
Use password store to store environment
[perso/Immae/Config/Nix.git] / nixops / scripts / nixops_wrap
CommitLineData
5f5efa6f
IB
1#!/bin/bash
2
3if [ -z "$NIXOPS_CONFIG_PASS_PATH" ]; then
4 echo "Please set NIXOPS_CONFIG_PASS_PATH to the password-store environment file path"
5 exit 1;
6fi
7
8TEMP=$(mktemp /tmp/XXXXXX-environment.nix)
9chmod go-rwx $TEMP
10
11finish() {
12 rm -f "$TEMP"
13 nixops set-args --unset environment
14}
15
16trap finish EXIT
17
18pass show "$NIXOPS_CONFIG_PASS_PATH" >> $TEMP
19nixops set-args --argstr environment "$TEMP"
20
21nixops "$@"