From adaf77b027ca6b62f8ae36d9fb120e79b2da927f Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Tue, 25 Nov 2025 10:23:58 -0500 Subject: [PATCH] refactor --- modules/home/work/juspay.nix | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/modules/home/work/juspay.nix b/modules/home/work/juspay.nix index f748619..8316c09 100644 --- a/modules/home/work/juspay.nix +++ b/modules/home/work/juspay.nix @@ -6,6 +6,7 @@ { flake, config, ... }: let + inherit (flake) self; inherit (flake.inputs) jumphost-nix agenix; in { @@ -14,16 +15,6 @@ in agenix.homeManagerModules.default ]; - age.secrets.juspay-anthropic-api-key.file = ../../../secrets/juspay-anthropic-api-key.age; - age.identityPaths = [ "${config.home.homeDirectory}/.ssh/agenix" ]; - - programs.zsh.initContent = '' - export ANTHROPIC_API_KEY="$(cat "${config.age.secrets.juspay-anthropic-api-key.path}")" - ''; - programs.bash.initExtra = '' - export ANTHROPIC_API_KEY="$(cat "${config.age.secrets.juspay-anthropic-api-key.path}")" - ''; - # https://github.com/srid/jumphost-nix programs.jumphost = { enable = true; @@ -43,10 +34,22 @@ in }; }; - # Mirroring configuration from https://github.com/juspay/vertex + # For Juspay LiteLLM AI configuration home.sessionVariables = { ANTHROPIC_BASE_URL = "https://grid.ai.juspay.net"; ANTHROPIC_MODEL = "claude-sonnet-4-5"; - # ANTHROPIC_API_KEY set in initExtra via agenix + # ANTHROPIC_API_KEY set in initExtra via agenix (see below) }; + age = { + identityPaths = [ "${config.home.homeDirectory}/.ssh/agenix" ]; + secrets = { + juspay-anthropic-api-key.file = self + /secrets/juspay-anthropic-api-key.age; + }; + }; + programs.zsh.initContent = '' + export ANTHROPIC_API_KEY="$(cat "${config.age.secrets.juspay-anthropic-api-key.path}")" + ''; + programs.bash.initExtra = '' + export ANTHROPIC_API_KEY="$(cat "${config.age.secrets.juspay-anthropic-api-key.path}")" + ''; }