pinwheel: Configure ct through its Home Manager module

This commit is contained in:
Alexander Heldt committed 2026-10-29 11:45:02 +01:00
1 parent cf5b74e251
commit 3f4a790b53
2 files changed
+26 -62

No files matched your search

+22 -58
View File
@@ -8,25 +8,6 @@
let
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.
statusLine = {
type = "command";
@@ -74,48 +55,31 @@ in
};
};
config = lib.mkIf enabled {
home-manager.users.alex = {
home.packages = [
pkgs.claude-code
ct
];
config = lib.mkMerge [
{ home-manager.sharedModules = [ inputs.ct.homeManagerModules.default ]; }
programs.zsh.shellAliases = {
claude = "pclaude";
wclaude = "CLAUDE_CONFIG_DIR=$HOME/.claude-work command claude";
pclaude = "CLAUDE_CONFIG_DIR=$HOME/.claude-personal command claude";
};
(lib.mkIf enabled {
home-manager.users.alex = {
home.packages = [ pkgs.claude-code ];
home.file.".claude-work/settings.json".text = settings;
home.file.".claude-personal/settings.json".text = settings;
xdg.configFile."ct/config.json".text = ctConfig;
programs.tmux.extraConfig = lib.mkAfter ''
bind-key T display-menu -T "ct" \
"New thread (full context)" t 'display-popup -EE -w 80 -h 10 -T " new thread " "ct thread --pane #{pane_id}"' \
"New thread (pick turns)" p 'display-popup -EE -w 90% -h 90% -T " pick turns " "ct thread --pick --pane #{pane_id}"' \
"" \
"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";
programs.zsh.shellAliases = {
claude = "pclaude";
wclaude = "CLAUDE_CONFIG_DIR=$HOME/.claude-work command claude";
pclaude = "CLAUDE_CONFIG_DIR=$HOME/.claude-personal command claude";
};
Service = {
Type = "simple";
ExecStart = "${lib.getExe ct} serve";
Environment = "TMUX_TMPDIR=%t";
Restart = "on-failure";
RestartSec = 5;
};
Install = {
WantedBy = [ "default.target" ];
home.file.".claude-work/settings.json".text = settings;
home.file.".claude-personal/settings.json".text = settings;
programs.ct = {
enable = true;
web.enable = true;
settings.profiles = {
work.configDir = "/home/alex/.claude-work";
personal.configDir = "/home/alex/.claude-personal";
};
};
};
};
};
})
];
}