Compare commits
2 Commits
09463d0dbb
...
067608f4f8
| Author | SHA1 | Date | |
|---|---|---|---|
| 067608f4f8 | |||
| 1e78149a4f |
@@ -49,9 +49,6 @@
|
|||||||
|
|
||||||
# Secrets management (WSL uses Windows op.exe via interop)
|
# Secrets management (WSL uses Windows op.exe via interop)
|
||||||
]
|
]
|
||||||
++ lib.optionals pkgs.stdenv.isDarwin [
|
|
||||||
_1password-cli
|
|
||||||
]
|
|
||||||
++ (with pkgs; [
|
++ (with pkgs; [
|
||||||
# AI coding agent
|
# AI coding agent
|
||||||
opencode
|
opencode
|
||||||
|
|||||||
+8
-4
@@ -1,9 +1,13 @@
|
|||||||
{ ... }:
|
{ config, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
envTpl = "${config.xdg.configHome}/op-env/env.tpl";
|
||||||
|
in
|
||||||
{
|
{
|
||||||
# ── 1Password env template ──────────────────────────
|
# ── 1Password env template ──────────────────────────
|
||||||
# op:// references only — no real secrets, safe to commit
|
# op:// references only — no real secrets, safe to commit
|
||||||
xdg.configFile."op/env.tpl".text = ''
|
# Kept outside ~/.config/op — that dir must be 700 and owned by op CLI
|
||||||
|
xdg.configFile."op-env/env.tpl".text = ''
|
||||||
AI_GATEWAY_BASE_URL={{ op://Private/AI Gateway API/URL }}
|
AI_GATEWAY_BASE_URL={{ op://Private/AI Gateway API/URL }}
|
||||||
AI_GATEWAY_API_KEY={{ op://Private/AI Gateway API/credential }}
|
AI_GATEWAY_API_KEY={{ op://Private/AI Gateway API/credential }}
|
||||||
EXA_API_KEY={{ op://Private/Exa API/credential }}
|
EXA_API_KEY={{ op://Private/Exa API/credential }}
|
||||||
@@ -62,10 +66,10 @@
|
|||||||
|
|
||||||
# 1Password → env vars (single op call, silent if locked)
|
# 1Password → env vars (single op call, silent if locked)
|
||||||
function op-env --description "Load secrets from 1Password"
|
function op-env --description "Load secrets from 1Password"
|
||||||
if not type -q op; or not test -f ~/.config/op/env.tpl
|
if not type -q op; or not test -f ${envTpl}
|
||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
for line in (op inject < ~/.config/op/env.tpl 2>/dev/null)
|
for line in (op inject < ${envTpl} 2>/dev/null)
|
||||||
string match -qr '^\s*(#|$)' -- $line; and continue
|
string match -qr '^\s*(#|$)' -- $line; and continue
|
||||||
set -l kv (string split -m 1 '=' $line)
|
set -l kv (string split -m 1 '=' $line)
|
||||||
if test (count $kv) -ge 2
|
if test (count $kv) -ge 2
|
||||||
|
|||||||
@@ -7,6 +7,9 @@
|
|||||||
# ── Shell ──────────────────────────────────────────
|
# ── Shell ──────────────────────────────────────────
|
||||||
programs.fish.enable = true;
|
programs.fish.enable = true;
|
||||||
|
|
||||||
|
# ── 1Password CLI ───────────────────────────────────
|
||||||
|
programs._1password.enable = true;
|
||||||
|
|
||||||
# ── SSH ───────────────────────────────────────────
|
# ── SSH ───────────────────────────────────────────
|
||||||
services.openssh.enable = true;
|
services.openssh.enable = true;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user