1
0
Fork 0

add pass plugin to read secrets from password store

This commit is contained in:
ibizaman 2022-09-13 21:07:40 -07:00
parent 23e69232c4
commit 6ae0c69fa5
2 changed files with 13 additions and 0 deletions

3
extra-builtins.nix Normal file
View file

@ -0,0 +1,3 @@
{ exec, ... }: {
pass = name: exec [./nix-pass.sh name];
}

10
nix-pass.sh Executable file
View file

@ -0,0 +1,10 @@
#!/usr/bin/env bash
# nix-pass.sh
set -euo pipefail
f=$(mktemp)
trap "rm $f" EXIT
pass show "$1" | head -c -1 > $f
nix-instantiate --eval -E "builtins.readFile $f"