]>
Commit | Line | Data |
---|---|---|
2caad890 | 1 | #!/usr/bin/env bash |
5f5efa6f | 2 | |
da28a4e2 IB |
3 | if [ -z "$NIXOPS_ENV_LOADED" ]; then |
4 | echo "Please load the environment with direnv" | |
4506dbe5 IB |
5 | exit 1; |
6 | fi | |
7 | ||
34abd6af | 8 | umask 0077 |
9690acd9 | 9 | TEMP=$(mktemp -d /tmp/XXXXXX-nixops-files) |
5f5efa6f IB |
10 | chmod go-rwx $TEMP |
11 | ||
12 | finish() { | |
9690acd9 | 13 | rm -rf "$TEMP" |
5f5efa6f IB |
14 | } |
15 | ||
16 | trap finish EXIT | |
17 | ||
9690acd9 | 18 | # pass cannot "just" list files in a directory without showing a tree :( |
1052bfda | 19 | files=$(pass ls Nixops/files | sed -e '1d' -e 's/^.* //') |
9690acd9 IB |
20 | |
21 | for file in $files; do | |
1052bfda | 22 | pass show "Nixops/files/$file" > $TEMP/$file |
9690acd9 | 23 | done |
34abd6af IB |
24 | |
25 | export NIX_PATH="privateFiles=$TEMP:$NIX_PATH" | |
26 | export SSH_IDENTITY_FILE="$TEMP/id_ed25519" | |
5f5efa6f | 27 | |
4506dbe5 | 28 | "$@" |