feat(agents): add gitIdentity module

- Renamed shared-options.nix to shared/shared-options.nix
- Created shared/default.nix importing git-identity.nix and shared-options.nix
- Created shared/git-identity.nix with gitIdentity option set:
  - enable: Toggle for agent git identity
  - name: Git author name (default: m3ta-chiron)
  - email: Git author email (default: m3ta-chiron@agentmail.to)
  - signingKey: Optional GPG signing key path
  - sshKey: SSH private key path for git push auth
- Updated opencode.nix, pi.nix, claude-code.nix to import shared/default.nix
- Restructured modules to follow proper Nix module syntax with imports at top level
This commit is contained in:
m3tm3re
2026-04-27 12:43:56 +02:00
parent 161be34111
commit 60aeec7cfe
6 changed files with 129 additions and 47 deletions

View File

@@ -3,14 +3,16 @@
lib,
pkgs,
...
}: let
shared = import ./shared-options.nix {inherit lib;};
in
with lib; let
cfg = config.coding.agents.claude-code;
}: {
imports = [
../shared/default.nix
];
options.coding.agents.claude-code = let
shared = import ../shared/shared-options.nix {inherit lib;};
mcpCfg = config.programs.mcp or null;
in {
options.coding.agents.claude-code = {
in
with lib; {
enable = mkEnableOption "Claude Code agent management via canonical agent.toml definitions";
agentsInput = shared.mkAgentsInputOption ''
@@ -38,9 +40,12 @@ in
};
};
config = mkIf cfg.enable (let
agentsLib = (import ../../../../lib {inherit lib;}).agents;
config = with lib; let
shared = import ../shared/shared-options.nix {inherit lib;};
cfg = config.coding.agents.claude-code;
agentsLib = (import ../../../../lib {inherit lib;}).agents;
in
mkIf cfg.enable (let
# Rendered agents + permissions (only if agentsInput is set)
rendered = mkIf (cfg.agentsInput != null) (
agentsLib.renderForClaudeCode {
@@ -86,4 +91,4 @@ in
source = "${settingsJson}";
};
});
}
}