claude: deploy settings and skills as managed policy in /etc #1499

Merged
JakeHillion merged 1 commits from jj/orvslqxpyunr into main 2026-12-05 20:14:25 +00:00
+12 -10
View File
@@ -5,6 +5,7 @@ let
claudeSettings = {
remoteControlAtStartup = false;
permissions.defaultMode = "auto";
attribution = {
commit = "";
pr = "";
@@ -57,19 +58,20 @@ in
mode = "0400";
};
# Managed settings and skills take precedence over the user's own, which
# leaves ~/.claude/settings.json for Claude Code to save its choices in.
environment.etc = {
"claude-code/managed-settings.json".text = builtins.toJSON claudeSettings;
"claude-code/.claude/skills/commit/SKILL.md".source = ./commit-skill/SKILL.md;
"claude-code/.claude/skills/github-fetch/SKILL.md".source = ./github-fetch-skill/SKILL.md;
"claude-code/.claude/skills/megamerge/SKILL.md".source = ./megamerge-skill/SKILL.md;
"claude-code/.claude/skills/megamerge-sync/SKILL.md".source = ./megamerge-sync-skill/SKILL.md;
"claude-code/.claude/skills/megamerge-place/SKILL.md".source = ./megamerge-place-skill/SKILL.md;
};
home-manager.users.${user} = {
home.file.".claude/CLAUDE.md".source = ./global-instructions.md;
# Deploy skills
home.file.".claude/skills/commit/SKILL.md".source = ./commit-skill/SKILL.md;
home.file.".claude/skills/github-fetch/SKILL.md".source = ./github-fetch-skill/SKILL.md;
home.file.".claude/skills/megamerge/SKILL.md".source = ./megamerge-skill/SKILL.md;
home.file.".claude/skills/megamerge-sync/SKILL.md".source = ./megamerge-sync-skill/SKILL.md;
home.file.".claude/skills/megamerge-place/SKILL.md".source = ./megamerge-place-skill/SKILL.md;
# Deploy settings with hooks configuration
home.file.".claude/settings.json".text = builtins.toJSON claudeSettings;
# Merge Context7 MCP server into ~/.claude.json at activation time
home.activation.claude-mcp-servers = ''
apiKey=$(${pkgs.coreutils}/bin/cat ${lib.escapeShellArg config.age.secrets."claude/context7-api-key".path})