pinwheel: Configure ct through its Home Manager module
This commit is contained in:
2 files changed
+17
-53
No files matched your search
Generated
+4
-4
@@ -63,11 +63,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1793195631,
|
"lastModified": 1793268531,
|
||||||
"narHash": "sha256-nPTYbsRaHpXt9ODwS6eozdRYr7FduQQQUydJqjfJ0KE=",
|
"narHash": "sha256-2FI3tNiVlp7XJ4xFSltzG8truDK7oGFzSZv3v+uERDU=",
|
||||||
"ref": "main",
|
"ref": "main",
|
||||||
"rev": "3667919bcf897acaa69497833e4230ab440de644",
|
"rev": "ba3e1a1d0b773277d37cd6750a01143296c0242d",
|
||||||
"revCount": 6,
|
"revCount": 12,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "ssh://gitea@git.ppp.pm:1122/alex/ct.git"
|
"url": "ssh://gitea@git.ppp.pm:1122/alex/ct.git"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -8,25 +8,6 @@
|
|||||||
let
|
let
|
||||||
enabled = config.mod.ai.enable;
|
enabled = config.mod.ai.enable;
|
||||||
|
|
||||||
ct = inputs.ct.packages.${pkgs.stdenv.hostPlatform.system}.default;
|
|
||||||
|
|
||||||
ctConfig = builtins.toJSON {
|
|
||||||
addr = "127.0.0.1:7777";
|
|
||||||
open = "split";
|
|
||||||
defaultProfile = "personal";
|
|
||||||
profiles = {
|
|
||||||
work = {
|
|
||||||
configDir = "/home/alex/.claude-work";
|
|
||||||
tmuxSession = "w";
|
|
||||||
paths = [ "/home/alex/code/work" ];
|
|
||||||
};
|
|
||||||
personal = {
|
|
||||||
configDir = "/home/alex/.claude-personal";
|
|
||||||
tmuxSession = "p";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# Shared statusline: show the logged-in account email.
|
# Shared statusline: show the logged-in account email.
|
||||||
statusLine = {
|
statusLine = {
|
||||||
type = "command";
|
type = "command";
|
||||||
@@ -74,12 +55,12 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf enabled {
|
config = lib.mkMerge [
|
||||||
|
{ home-manager.sharedModules = [ inputs.ct.homeManagerModules.default ]; }
|
||||||
|
|
||||||
|
(lib.mkIf enabled {
|
||||||
home-manager.users.alex = {
|
home-manager.users.alex = {
|
||||||
home.packages = [
|
home.packages = [ pkgs.claude-code ];
|
||||||
pkgs.claude-code
|
|
||||||
ct
|
|
||||||
];
|
|
||||||
|
|
||||||
programs.zsh.shellAliases = {
|
programs.zsh.shellAliases = {
|
||||||
claude = "pclaude";
|
claude = "pclaude";
|
||||||
@@ -90,32 +71,15 @@ in
|
|||||||
home.file.".claude-work/settings.json".text = settings;
|
home.file.".claude-work/settings.json".text = settings;
|
||||||
home.file.".claude-personal/settings.json".text = settings;
|
home.file.".claude-personal/settings.json".text = settings;
|
||||||
|
|
||||||
xdg.configFile."ct/config.json".text = ctConfig;
|
programs.ct = {
|
||||||
|
enable = true;
|
||||||
programs.tmux.extraConfig = lib.mkAfter ''
|
web.enable = true;
|
||||||
bind-key T display-menu -T "ct" \
|
settings.profiles = {
|
||||||
"New thread (full context)" t 'display-popup -EE -w 80 -h 10 -T " new thread " "ct thread --pane #{pane_id}"' \
|
work.configDir = "/home/alex/.claude-work";
|
||||||
"New thread (pick turns)" p 'display-popup -EE -w 90% -h 90% -T " pick turns " "ct thread --pick --pane #{pane_id}"' \
|
personal.configDir = "/home/alex/.claude-personal";
|
||||||
"" \
|
|
||||||
"Browse threads" b 'display-popup -EE -w 90% -h 90% -T " threads " "ct --pane #{pane_id}"' \
|
|
||||||
"Open in browser" w 'run-shell -b "ct web --pane #{pane_id}"'
|
|
||||||
'';
|
|
||||||
|
|
||||||
systemd.user.services.ct-web = {
|
|
||||||
Unit = {
|
|
||||||
Description = "ct web UI";
|
|
||||||
};
|
|
||||||
Service = {
|
|
||||||
Type = "simple";
|
|
||||||
ExecStart = "${lib.getExe ct} serve";
|
|
||||||
Environment = "TMUX_TMPDIR=%t";
|
|
||||||
Restart = "on-failure";
|
|
||||||
RestartSec = 5;
|
|
||||||
};
|
|
||||||
Install = {
|
|
||||||
WantedBy = [ "default.target" ];
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
})
|
||||||
|
];
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user