From 3c6910cfb1ffd378890eff44871016375564cde4 Mon Sep 17 00:00:00 2001 From: imbytecat Date: Mon, 13 Apr 2026 20:13:38 +0800 Subject: [PATCH] fix(fish): use --in-file for op inject to fix stdin issue in command substitution --- home/default.nix | 1 - home/shell/fish.nix | 6 ++++-- modules/darwin/default.nix | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/home/default.nix b/home/default.nix index 8b3a2ae..7963846 100644 --- a/home/default.nix +++ b/home/default.nix @@ -1,6 +1,5 @@ { inputs, - lib, username, pkgs, ... diff --git a/home/shell/fish.nix b/home/shell/fish.nix index fd78cef..79e996d 100644 --- a/home/shell/fish.nix +++ b/home/shell/fish.nix @@ -64,12 +64,14 @@ in source ~/.config/fish/local.fish end - # 1Password → env vars (single op call, silent if locked) + # 1Password → env vars (single op call, silent on failure) function op-env --description "Load secrets from 1Password" if not type -q op; or not test -f ${envTpl} return 1 end - for line in (op inject < ${envTpl} 2>/dev/null) + set -l output (op inject --in-file ${envTpl} 2>/dev/null) + or return 1 + for line in $output string match -qr '^\s*(#|$)' -- $line; and continue set -l kv (string split -m 1 '=' $line) if test (count $kv) -ge 2 diff --git a/modules/darwin/default.nix b/modules/darwin/default.nix index 0378360..0e03a34 100644 --- a/modules/darwin/default.nix +++ b/modules/darwin/default.nix @@ -86,6 +86,7 @@ "raycast" "spotify" "telegram-desktop" + "tencent-meeting" "termius" "visual-studio-code" "wechat"