diff --git a/dotfiles/config/hypr/hyprland/scratchpads.lua b/dotfiles/config/hypr/hyprland/scratchpads.lua index 9c0869d5..737e31a4 100644 --- a/dotfiles/config/hypr/hyprland/scratchpads.lua +++ b/dotfiles/config/hypr/hyprland/scratchpads.lua @@ -19,7 +19,7 @@ function M.setup(ctx) }, claude = { command = "claude-desktop", - class = "claude-desktop", + classes = { "com.anthropic.Claude", "claude-desktop" }, }, htop = { command = "alacritty --class htop-scratch --title htop -e htop", diff --git a/dotfiles/config/hypr/hyprland/settings.lua b/dotfiles/config/hypr/hyprland/settings.lua index 26e4fcdc..7983d93f 100644 --- a/dotfiles/config/hypr/hyprland/settings.lua +++ b/dotfiles/config/hypr/hyprland/settings.lua @@ -428,7 +428,7 @@ function M.setup(ctx) -- whatever window the user is actually working in. focus_on_activate is -- a dynamic rule (applies to already-mapped windows on reload); -- 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({ name = "ai-app-no-activate-focus-" .. tostring(index), match = { class = class }, diff --git a/nixos/code.nix b/nixos/code.nix index 24b9170f..50cb28c1 100644 --- a/nixos/code.nix +++ b/nixos/code.nix @@ -50,6 +50,16 @@ in nix-direnv.enable = true; }; + # Claude Desktop downloads its own generic-linux Claude Code build to + # ~/.config/Claude/claude-code//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; 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 # integrated Claude Code terminal can use sudo / nixos-rebuild. The FHS # variant (claudeDesktopFhs) sandboxes everything in an unprivileged user - # namespace, which makes host root impossible. Trade-off: MCP/Cowork - # features that assume an FHS layout may need nix-ld/envfs instead. + # namespace, which makes host root impossible. The FHS layout the app's + # downloaded native binaries expect is supplied by nix-ld above instead. claudeDesktop cabal2nix ]