my nixos/home-manager configuration
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

add codex with context7

+80
+3
home-manager/clever-cloud.nix
··· 17 17 ]; 18 18 19 19 programs = { 20 + onepassword-secrets.enable = true; 21 + 20 22 # cli 21 23 git = { 22 24 enable = true; ··· 46 48 } 47 49 ]; 48 50 }; 51 + codex.enable = true; 49 52 50 53 # gui 51 54 ghostty.enable = true;
+3
home-manager/desktop.nix
··· 19 19 ]; 20 20 21 21 programs = { 22 + onepassword-secrets.enable = true; 23 + 22 24 # cli 23 25 git = { 24 26 enable = true; ··· 67 69 } 68 70 ]; 69 71 }; 72 + codex.enable = true; 70 73 71 74 # gui 72 75 ghostty.enable = true;
+3
home-manager/laptop.nix
··· 19 19 ]; 20 20 21 21 programs = { 22 + onepassword-secrets.enable = true; 23 + 22 24 # cli 23 25 git = { 24 26 enable = true; ··· 67 69 } 68 70 ]; 69 71 }; 72 + codex.enable = true; 70 73 71 74 # gui 72 75 ghostty.enable = true;
+44
home-manager/modules/codex.nix
··· 1 + { 2 + config, 3 + pkgs, 4 + lib, 5 + ... 6 + }: 7 + 8 + let 9 + cfg = config.programs.codex; 10 + 11 + nodejsPkg = pkgs.nodejs_22; 12 + 13 + context7ApiKeyPath = config.programs.onepassword-secrets.secretPaths."context7ApiKey"; 14 + 15 + context7Runner = pkgs.writeShellScriptBin "context7-mcp-runner" '' 16 + export PATH="${lib.makeBinPath [ nodejsPkg ]}:$PATH" 17 + export CONTEXT7_API_KEY="$(${pkgs.coreutils}/bin/cat ${context7ApiKeyPath})" 18 + exec "${nodejsPkg}/bin/npx" -y @upstash/context7-mcp 19 + ''; 20 + in 21 + { 22 + config = lib.mkIf cfg.enable { 23 + home.packages = [ 24 + context7Runner 25 + ]; 26 + 27 + programs.codex = { 28 + package = pkgs.unstable.codex; 29 + custom-instructions = '' 30 + Always use context7 when I need code generation, setup or configuration steps, or 31 + library/API documentation. This means you should automatically use the Context7 MCP 32 + tools to resolve library id and get library docs without me having to explicitly ask. 33 + ''; 34 + settings = { 35 + mcp_servers = { 36 + context7 = { 37 + command = "context7-mcp-runner"; 38 + args = [ ]; 39 + }; 40 + }; 41 + }; 42 + }; 43 + }; 44 + }
+27
home-manager/modules/onepassword-secrets.nix
··· 1 + { 2 + config, 3 + lib, 4 + ... 5 + }: 6 + 7 + let 8 + cfg = config.programs.onepassword-secrets; 9 + in 10 + { 11 + config = lib.mkIf cfg.enable { 12 + programs.onepassword-secrets = { 13 + # 0440 youn:onepassword-secrets 14 + tokenFile = "/etc/opnix-token"; 15 + 16 + secrets = { 17 + context7ApiKey = { 18 + reference = "op://OpNix/Context7 API Key/credential"; 19 + path = ".opnix/secrets/context7-api-key"; 20 + mode = "0600"; 21 + owner = "youn"; 22 + group = "users"; 23 + }; 24 + }; 25 + }; 26 + }; 27 + }