refactor: replace sops-nix with 1Password CLI for secrets management

This commit is contained in:
2026-04-13 14:57:11 +08:00
parent 2f6e3aea89
commit b9e8566cee
10 changed files with 21 additions and 146 deletions
+19
View File
@@ -1,6 +1,15 @@
{ ... }:
{
# ── 1Password env template ──────────────────────────
# op:// references only — no real secrets, safe to commit
xdg.configFile."op/env.tpl".text = ''
AI_GATEWAY_BASE_URL={{ op://Private/AI Gateway API/URL }}
AI_GATEWAY_API_KEY={{ op://Private/AI Gateway API/ }}
EXA_API_KEY={{ op://Private/Exa API/ }}
CONTEXT7_API_KEY={{ op://Private/Context7 API/ }}
'';
programs.fish = {
enable = true;
@@ -49,6 +58,16 @@
if test -f ~/.config/fish/local.fish
source ~/.config/fish/local.fish
end
# 1Password env vars (single op call, silent if locked)
if command -q op
for line in (op inject -i ~/.config/op/env.tpl 2>/dev/null)
set -l kv (string split -m 1 '=' $line)
if test (count $kv) -ge 2
set -gx $kv[1] $kv[2]
end
end
end
'';
};
}