mirror of
https://github.com/srid/nixos-config.git
synced 2025-12-26 06:54:57 +08:00
Claude Code home-manager configuration (#96)
* Init * Refactor subagents
This commit is contained in:
parent
aa496a363c
commit
51ef14630e
9 changed files with 61 additions and 33 deletions
|
|
@ -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
2
.gitignore
vendored
|
|
@ -1,3 +1,5 @@
|
|||
/result
|
||||
/.direnv
|
||||
/.pre-commit-config.yaml
|
||||
|
||||
/.claude/settings.local.json
|
||||
10
.mcp.json
10
.mcp.json
|
|
@ -1,10 +0,0 @@
|
|||
{
|
||||
"mcpServers": {
|
||||
"nixos-mcp": {
|
||||
"command": "uvx",
|
||||
"args": [
|
||||
"mcp-nixos"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
|
||||
## 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
6
flake.lock
generated
|
|
@ -1402,11 +1402,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1753563501,
|
||||
"narHash": "sha256-w8dykt5g06EB3yD/knx55MqsXvVHsoXfUbuBEWvT5H4=",
|
||||
"lastModified": 1756319815,
|
||||
"narHash": "sha256-a/TrhQh+U43XjcJZehq3/rjb5UXiyaJljQRoFLU1KyM=",
|
||||
"owner": "juspay",
|
||||
"repo": "vertex",
|
||||
"rev": "7917e3f0e755bc32fd29a7593b630ee74f26c692",
|
||||
"rev": "b8ee43c50a021514f4694c018bc9dd989ba2c47f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
|
|||
|
|
@ -36,7 +36,6 @@ in
|
|||
# AI
|
||||
gemini-cli
|
||||
google-cloud-sdk
|
||||
inputs.vertex.packages.${pkgs.system}.default
|
||||
|
||||
# Publishing
|
||||
asciinema
|
||||
|
|
@ -69,8 +68,6 @@ in
|
|||
lg = "lazygit";
|
||||
l = "ls";
|
||||
beep = "say 'beep'";
|
||||
|
||||
claude = "vertex-claude";
|
||||
};
|
||||
|
||||
programs = {
|
||||
|
|
|
|||
49
modules/home/claude-code/default.nix
Normal file
49
modules/home/claude-code/default.nix
Normal 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" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -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
|
||||
|
||||
## Purpose
|
||||
|
|
@ -13,6 +13,6 @@
|
|||
./all/just.nix
|
||||
./all/juspay.nix
|
||||
|
||||
./all/_1password.nix
|
||||
./claude-code
|
||||
];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue