Claude Code home-manager configuration (#96)

* Init

* Refactor subagents
This commit is contained in:
Sridhar Ratnakumar 2025-08-27 14:54:38 -04:00 committed by GitHub
parent aa496a363c
commit 51ef14630e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 61 additions and 33 deletions

View file

@ -1,15 +0,0 @@
{
"enableAllProjectMcpServers": true,
"permissions": {
"defaultMode": "plan",
"allow": [
// Nix
"Bash(nix develop:*)",
"Bash(nix build:*)",
"Bash(om ci)",
// Read files
"Bash(rg:*)"
]
}
}

2
.gitignore vendored
View file

@ -1,3 +1,5 @@
/result /result
/.direnv /.direnv
/.pre-commit-config.yaml /.pre-commit-config.yaml
/.claude/settings.local.json

View file

@ -1,10 +0,0 @@
{
"mcpServers": {
"nixos-mcp": {
"command": "uvx",
"args": [
"mcp-nixos"
]
}
}
}

View file

@ -1,4 +1,4 @@
## Local CI ## Local CI
- You can test your changes by running `om ci` locally. - You can test your changes by running `nix build` on the relevant configuration.

6
flake.lock generated
View file

@ -1402,11 +1402,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1753563501, "lastModified": 1756319815,
"narHash": "sha256-w8dykt5g06EB3yD/knx55MqsXvVHsoXfUbuBEWvT5H4=", "narHash": "sha256-a/TrhQh+U43XjcJZehq3/rjb5UXiyaJljQRoFLU1KyM=",
"owner": "juspay", "owner": "juspay",
"repo": "vertex", "repo": "vertex",
"rev": "7917e3f0e755bc32fd29a7593b630ee74f26c692", "rev": "b8ee43c50a021514f4694c018bc9dd989ba2c47f",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -36,7 +36,6 @@ in
# AI # AI
gemini-cli gemini-cli
google-cloud-sdk google-cloud-sdk
inputs.vertex.packages.${pkgs.system}.default
# Publishing # Publishing
asciinema asciinema
@ -69,8 +68,6 @@ in
lg = "lazygit"; lg = "lazygit";
l = "ls"; l = "ls";
beep = "say 'beep'"; beep = "say 'beep'";
claude = "vertex-claude";
}; };
programs = { programs = {

View file

@ -0,0 +1,49 @@
{ flake, pkgs, lib, ... }:
let
subagentsDir = ./subagents;
agents = lib.flip lib.mapAttrs' (lib.filterAttrs (fileName: fileType: fileType == "regular" && lib.hasSuffix ".md" fileName) (builtins.readDir subagentsDir))
(fileName: _: lib.nameValuePair (lib.removeSuffix ".md" fileName) (builtins.readFile (subagentsDir + "/${fileName}")));
in
{
programs.claude-code = {
enable = true;
# Wrapped Claude Code with Google Vertex AI auth
# See https://github.com/juspay/vertex
package = flake.inputs.vertex.packages.${pkgs.system}.default;
# Basic settings for Claude Code
settings = {
enableAllProjectMcpServers = true;
permissions = {
defaultMode = "plan";
allow = [
"Bash(nix develop:*)"
"Bash(nix build:*)"
"Bash(om ci)"
"Bash(rg:*)"
];
};
};
# Custom commands can be added here
commands = {
"om-ci" = ''
#!/bin/bash
# Run local CI (Nix)
om ci
'';
};
# Automatically discovered agents from subagents/ directory
agents = agents;
# MCP servers configuration
mcpServers = {
"nixos-mcp" = {
command = "uvx";
args = [ "mcp-nixos" ];
};
};
};
}

View file

@ -1,3 +1,8 @@
---
name: pre-commit
description: Invoke after changing sources locally, and only if git-hooks.nix is used by Nix.
tools: Bash
---
# Pre-commit Quality Check Agent # Pre-commit Quality Check Agent
## Purpose ## Purpose

View file

@ -13,6 +13,6 @@
./all/just.nix ./all/just.nix
./all/juspay.nix ./all/juspay.nix
./all/_1password.nix ./claude-code
]; ];
} }