Skip to content

Commit 86216e9

Browse files
committed
Update desktop services and T3 Code keybindings
1 parent 00893ae commit 86216e9

7 files changed

Lines changed: 168 additions & 103 deletions

File tree

AGENTS.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,9 @@
55
explicitly asks for the change to be made there. Put packages and
66
configuration intended for every user in the appropriate shared NixOS or Home
77
Manager module instead.
8+
9+
## Browser Automation
10+
11+
- Prefer the Chrome plugin for tasks that can be completed entirely in a
12+
browser. Use computer-use tools when the task requires broader desktop
13+
interaction or the Chrome plugin cannot complete it.
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{
2+
config,
3+
lib,
4+
pkgs,
5+
...
6+
}: let
7+
bindings = builtins.fromJSON (builtins.readFile ../t3code-keybindings.json);
8+
bindingsJson = builtins.toJSON bindings;
9+
keybindingsPath = "${config.home.homeDirectory}/.t3/userdata/keybindings.json";
10+
installBindings = pkgs.writeShellScript "install-t3code-keybindings" ''
11+
set -eu
12+
13+
keybindings_path=${lib.escapeShellArg keybindingsPath}
14+
if [ ! -f "$keybindings_path" ]; then
15+
exit 0
16+
fi
17+
18+
keybindings_dir="$(${pkgs.coreutils}/bin/dirname "$keybindings_path")"
19+
temporary="$(${pkgs.coreutils}/bin/mktemp "$keybindings_dir/.keybindings.json.XXXXXX")"
20+
trap '${pkgs.coreutils}/bin/rm -f "$temporary"' EXIT
21+
22+
${pkgs.jq}/bin/jq \
23+
--argjson desired ${lib.escapeShellArg bindingsJson} \
24+
'($desired | map(.key)) as $keys
25+
| ($desired | map(.command)) as $commands
26+
| [.[] as $binding
27+
| select(($keys | index($binding.key)) == null and ($commands | index($binding.command)) == null)
28+
| $binding]
29+
+ $desired' \
30+
"$keybindings_path" > "$temporary"
31+
32+
if ${pkgs.diffutils}/bin/cmp -s "$keybindings_path" "$temporary"; then
33+
exit 0
34+
fi
35+
${pkgs.coreutils}/bin/chmod 0600 "$temporary"
36+
${pkgs.coreutils}/bin/mv "$temporary" "$keybindings_path"
37+
trap - EXIT
38+
'';
39+
in {
40+
home.activation.installT3CodeKeybindings = lib.hm.dag.entryAfter ["writeBoundary"] ''
41+
${installBindings}
42+
'';
43+
44+
systemd.user.services.t3code-keybindings = lib.mkIf pkgs.stdenv.isLinux {
45+
Unit.Description = "Install personal T3 Code keybindings";
46+
Service = {
47+
Type = "oneshot";
48+
ExecStart = "${installBindings}";
49+
};
50+
Install.WantedBy = ["default.target"];
51+
};
52+
53+
systemd.user.paths.t3code-keybindings = lib.mkIf pkgs.stdenv.isLinux {
54+
Unit.Description = "Watch the T3 Code keybindings file";
55+
Path = {
56+
PathChanged = keybindingsPath;
57+
Unit = "t3code-keybindings.service";
58+
};
59+
Install.WantedBy = ["default.target"];
60+
};
61+
}

nix-shared/t3code-keybindings.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
[
2+
{
3+
"key": "f13",
4+
"command": "model.select.claudeAgent.claude-fable-5"
5+
},
6+
{
7+
"key": "f14",
8+
"command": "model.select.claudeAgent.claude-opus-5"
9+
},
10+
{
11+
"key": "f15",
12+
"command": "model.select.codex.gpt-5.6-sol"
13+
},
14+
{
15+
"key": "f16",
16+
"command": "model.select.codex.gpt-5.6-luna"
17+
},
18+
{
19+
"key": "f17",
20+
"command": "reasoning.select.low"
21+
},
22+
{
23+
"key": "f18",
24+
"command": "reasoning.select.medium"
25+
},
26+
{
27+
"key": "f19",
28+
"command": "reasoning.select.high"
29+
}
30+
]

nixos/android.nix

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
};
44
config = {
55
nixpkgs.config.android_sdk.accept_license = true;
6-
environment.systemPackages = [pkgs.android-tools];
6+
environment.systemPackages = [
7+
pkgs.android-tools
8+
pkgs.scrcpy
9+
];
710
};
811
}

nixos/code.nix

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ in
6464
];
6565

6666
home-manager.users.imalison = lib.mkIf config.myModules.desktop.enable {
67+
imports = [../nix-shared/home-manager/t3code-keybindings.nix];
68+
6769
programs.codex = {
6870
enable = true;
6971
package = pkgs.codex;
@@ -73,26 +75,7 @@ in
7375
enable = true;
7476
cliPackage = pkgs.codex;
7577
computerUseUi.enable = true;
76-
remoteMobileControl.enable = true;
7778
linuxFeatures = ["shallow-repository-watches"];
78-
remoteControl = {
79-
enable = true;
80-
package = pkgs.codex;
81-
extraPackages = with pkgs; [
82-
bash
83-
coreutils
84-
findutils
85-
git
86-
gnugrep
87-
gnused
88-
nix
89-
nodejs
90-
openssh
91-
ripgrep
92-
zsh
93-
];
94-
listen = "ws://127.0.0.1:46231";
95-
};
9679
};
9780
};
9881

0 commit comments

Comments
 (0)