Improve Claude Desktop host integration
This commit is contained in:
@@ -19,7 +19,7 @@ function M.setup(ctx)
|
|||||||
},
|
},
|
||||||
claude = {
|
claude = {
|
||||||
command = "claude-desktop",
|
command = "claude-desktop",
|
||||||
class = "claude-desktop",
|
classes = { "com.anthropic.Claude", "claude-desktop" },
|
||||||
},
|
},
|
||||||
htop = {
|
htop = {
|
||||||
command = "alacritty --class htop-scratch --title htop -e htop",
|
command = "alacritty --class htop-scratch --title htop -e htop",
|
||||||
|
|||||||
@@ -428,7 +428,7 @@ function M.setup(ctx)
|
|||||||
-- whatever window the user is actually working in. focus_on_activate is
|
-- whatever window the user is actually working in. focus_on_activate is
|
||||||
-- a dynamic rule (applies to already-mapped windows on reload);
|
-- a dynamic rule (applies to already-mapped windows on reload);
|
||||||
-- suppress_event only applies at map time.
|
-- suppress_event only applies at map time.
|
||||||
for index, class in ipairs({ "^(claude-desktop)$", "^(codex-desktop)$" }) do
|
for index, class in ipairs({ "^(com\\.anthropic\\.Claude|claude-desktop)$", "^(codex-desktop)$" }) do
|
||||||
hl.window_rule({
|
hl.window_rule({
|
||||||
name = "ai-app-no-activate-focus-" .. tostring(index),
|
name = "ai-app-no-activate-focus-" .. tostring(index),
|
||||||
match = { class = class },
|
match = { class = class },
|
||||||
|
|||||||
@@ -50,6 +50,16 @@ in
|
|||||||
nix-direnv.enable = true;
|
nix-direnv.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Claude Desktop downloads its own generic-linux Claude Code build to
|
||||||
|
# ~/.config/Claude/claude-code/<version>/claude and execs it for every
|
||||||
|
# session. That binary is dynamically linked against /lib64/ld-linux-x86-64.so.2,
|
||||||
|
# which on stock NixOS is stub-ld, so it dies with exit 127. The FHS variant
|
||||||
|
# used to supply a loader inside its bwrap sandbox; running claude-desktop
|
||||||
|
# non-FHS (so the integrated terminal can sudo) takes that away. nix-ld puts a
|
||||||
|
# real loader back at the FHS path, for that binary and any other prebuilt
|
||||||
|
# native tooling (MCP servers, Cowork) these apps fetch at runtime.
|
||||||
|
programs.nix-ld.enable = true;
|
||||||
|
|
||||||
hardware.uinput.enable = lib.mkIf config.myModules.desktop.enable true;
|
hardware.uinput.enable = lib.mkIf config.myModules.desktop.enable true;
|
||||||
|
|
||||||
programs.ydotool = lib.mkIf config.myModules.desktop.enable {
|
programs.ydotool = lib.mkIf config.myModules.desktop.enable {
|
||||||
@@ -189,8 +199,8 @@ in
|
|||||||
# Non-FHS variant: runs in the host namespace (no bwrap userns), so the
|
# Non-FHS variant: runs in the host namespace (no bwrap userns), so the
|
||||||
# integrated Claude Code terminal can use sudo / nixos-rebuild. The FHS
|
# integrated Claude Code terminal can use sudo / nixos-rebuild. The FHS
|
||||||
# variant (claudeDesktopFhs) sandboxes everything in an unprivileged user
|
# variant (claudeDesktopFhs) sandboxes everything in an unprivileged user
|
||||||
# namespace, which makes host root impossible. Trade-off: MCP/Cowork
|
# namespace, which makes host root impossible. The FHS layout the app's
|
||||||
# features that assume an FHS layout may need nix-ld/envfs instead.
|
# downloaded native binaries expect is supplied by nix-ld above instead.
|
||||||
claudeDesktop
|
claudeDesktop
|
||||||
cabal2nix
|
cabal2nix
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user