mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 18:41:34 +01:00
sops: Ensure BW_SESSION and SOPS_AGE_KEY are only fetched if not already defined
This commit is contained in:
parent
e3479f2070
commit
312036e7a7
2 changed files with 14 additions and 7 deletions
|
|
@ -49,11 +49,14 @@
|
|||
|
||||
nativeBuildInputs = [ pkgs.bitwarden-cli ];
|
||||
shellHook = ''
|
||||
if BW_SESSION="$(bw unlock --raw || bw login --raw)"; then
|
||||
if ! declare -px BW_SESSION >/dev/null 2>&1; then
|
||||
BW_SESSION="$(bw unlock --raw || bw login --raw)"
|
||||
export BW_SESSION
|
||||
fi
|
||||
SOPS_AGE_KEY="$(bw get notes 'admin age-key')"
|
||||
export SOPS_AGE_KEY
|
||||
if ! declare -px SOPS_AGE_KEY >/dev/null 2>&1; then
|
||||
SOPS_AGE_KEY="$(bw get notes 'admin age-key')"
|
||||
export SOPS_AGE_KEY
|
||||
fi
|
||||
SOPS_CONFIG="${self'.packages.sops-config}"
|
||||
export SOPS_CONFIG
|
||||
'';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue