fix(zsh): load sops secrets through symlinks

sops-nix links each decrypted secret into
$XDG_CONFIG_HOME/secrets/global-env. The loader used the zsh glob
qualifier (N.), which matches plain files only, so it skipped every
symlink and exported no secret. Use (N-.) to match symlinks to plain
files as well.
This commit is contained in:
Rasyidan Akbar F. 2026-09-18 19:04:28 +07:00
commit 546203dc53

View file

@ -41,7 +41,9 @@
[[ -d "$secret_dir" ]] || return 0
for secret_file in "$secret_dir"/*(N.); do
# `-.` matches plain files and symlinks to plain files.
# sops-nix links each runtime secret into this directory.
for secret_file in "$secret_dir"/*(N-.); do
name="''${secret_file:t}"
[[ "$name" =~ '^[A-Za-z_][A-Za-z0-9_]*$' ]] || continue
value="$(<"$secret_file")"