my nixos/home-manager configuration
1
fork

Configure Feed

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

add github mcp to codex

+23 -1
+16 -1
home-manager/modules/codex.nix
··· 10 10 11 11 nodejsPkg = pkgs.nodejs_22; 12 12 13 - context7ApiKeyPath = config.programs.onepassword-secrets.secretPaths."context7ApiKey"; 13 + context7ApiKeyPath = config.programs.onepassword-secrets.secretPaths.context7ApiKey; 14 + githubPersonalAccessTokenPath = 15 + config.programs.onepassword-secrets.secretPaths.githubPersonalAccessToken; 14 16 15 17 context7Runner = pkgs.writeShellScriptBin "context7-mcp-runner" '' 16 18 export PATH="${lib.makeBinPath [ nodejsPkg ]}:$PATH" 17 19 export CONTEXT7_API_KEY="$(${pkgs.coreutils}/bin/cat ${context7ApiKeyPath})" 18 20 exec "${nodejsPkg}/bin/npx" -y @upstash/context7-mcp 21 + ''; 22 + 23 + githubRunner = pkgs.writeShellScriptBin "github-mcp-runner" '' 24 + export GITHUB_PERSONAL_ACCESS_TOKEN="$(${pkgs.coreutils}/bin/cat ${githubPersonalAccessTokenPath})" 25 + exec "${pkgs.unstable.github-mcp-server}/bin/github-mcp-server" stdio 19 26 ''; 20 27 in 21 28 { 22 29 config = lib.mkIf cfg.enable { 23 30 home.packages = [ 24 31 context7Runner 32 + githubRunner 25 33 ]; 26 34 27 35 programs.codex = { ··· 30 38 Always use context7 when I need code generation, setup or configuration steps, or 31 39 library/API documentation. This means you should automatically use the Context7 MCP 32 40 tools to resolve library id and get library docs without me having to explicitly ask. 41 + 42 + Always use github when I need to interact with GitHub repositories, such as reading 43 + pull requests, issues, or fetching repository information. 33 44 ''; 34 45 settings = { 35 46 mcp_servers = { 36 47 context7 = { 37 48 command = "context7-mcp-runner"; 49 + args = [ ]; 50 + }; 51 + github = { 52 + command = "github-mcp-runner"; 38 53 args = [ ]; 39 54 }; 40 55 };
+7
home-manager/modules/onepassword-secrets.nix
··· 21 21 owner = "youn"; 22 22 group = "users"; 23 23 }; 24 + githubPersonalAccessToken = { 25 + reference = "op://OpNix/Github Personal Access Token/credential"; 26 + path = ".opnix/secrets/github-personal-access-token"; 27 + mode = "0600"; 28 + owner = "youn"; 29 + group = "users"; 30 + }; 24 31 }; 25 32 }; 26 33 };