From 784ea6bceac9fd2f3e31ced2cfed2a7d840ba5a7 Mon Sep 17 00:00:00 2001 From: Martin Pander Date: Thu, 23 Jul 2026 16:06:38 +0200 Subject: [PATCH] Add langdock api key env var on work mode --- modules/home/opencode.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/modules/home/opencode.nix b/modules/home/opencode.nix index be8a466..72f8e29 100644 --- a/modules/home/opencode.nix +++ b/modules/home/opencode.nix @@ -88,5 +88,14 @@ in # Link the generated config to the expected location xdg.configFile."opencode/opencode.json".source = config.lib.file.mkOutOfStoreSymlink config.sops.templates."opencode/opencode.json".path; + + # Export the decrypted langdock API key as an env var (work config only). + # The secret lives in a runtime file, so we read it at shell startup rather + # than baking it into the Nix store via home.sessionVariables. + programs.zsh.initContent = lib.mkIf cfg.workMode '' + if [ -r "${config.sops.secrets.langdock_api_key.path}" ]; then + export LANGDOCK_API_KEY="$(cat "${config.sops.secrets.langdock_api_key.path}")" + fi + ''; }; }