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 + ''; }; }