6 Commits

Author SHA1 Message Date
Alexis Williams
0ce0f24e8c fix: move claude-desktop-fhs to let block so default can reference it
The packages attrset referenced claude-desktop-fhs for the default
attribute, but without rec the name wasn't in scope. Move the
definition to the let block and use inherit instead.

Co-Authored-By: Claude <claude@anthropic.com>
2026-03-30 18:59:00 -07:00
aaddrick
dccc94b80e fix: default Nix flake to FHS package for NixOS compatibility
Dynamically linked binaries downloaded at runtime (e.g., the Cowork CLI)
fail on NixOS because standard linker paths don't exist. The FHS package
wraps the app in a buildFHSEnv that provides these paths, fixing the
issue for all current and future downloaded binaries.

Users on non-NixOS distros using Nix can still explicitly select the
non-FHS package via `claude-desktop` if needed.

Fixes #355

Co-Authored-By: Claude <claude@anthropic.com>
2026-03-30 10:00:09 -04:00
Alexis Williams
99c9f753f5 fix: allow unfree evaluation for flake package outputs
The perSystem pkgs instance had no allowUnfree config, so consumers
using `inputs'.claude-desktop-debian.packages.claude-desktop` would
hit an unfree license error even if their own nixpkgs allows unfree.
Override _module.args.pkgs with allowUnfreePredicate for claude-desktop.
2026-02-28 15:14:33 -08:00
Alexis Williams
9fe293d4d0 refactor: simplify nix integration and fix node-pty/tray bugs
- Wire up --node-pty-dir flag in install_node_pty and finalize_app_asar
  (was parsed but never used; nix builds had no node-pty binaries)
- Set electron_resources_dest for nix builds so process_icons has a
  tray icon destination; update nix installPhase to match
- Remove unused lib param from fhs.nix
- Add missing source_dir global declaration
- Fix flake.nix whitespace

Co-Authored-By: Claude <claude@anthropic.com>
2026-02-28 15:14:33 -08:00
Alexis Williams
caa58cae8d feat: add node-pty Nix derivation for terminal support
Build node-pty from source using buildNpmPackage so Claude Desktop's
terminal features (Claude Code) work on NixOS. The derivation handles
three issues with the upstream package:

- Strips macOS-only fsevents reference from package-lock.json so
  npm ci doesn't fail on lock/json mismatch
- Runs both tsc (TypeScript to JS) and node-gyp rebuild (native addon)
- Copies build/Release/pty.node into output since npmInstallHook
  doesn't include native addons

Also wires node-pty into claude-desktop.nix via --node-pty-dir flag
and updates the flake overlay to expose it.

Co-Authored-By: Claude <claude@anthropic.com>
2026-02-28 15:14:33 -08:00
Alexis Williams
d7606aa68f feat: add flake.nix with flake-parts
Defines claude-desktop and claude-desktop-fhs packages for
x86_64-linux and aarch64-linux, plus an overlay for NixOS configs.

Co-Authored-By: Claude <claude@anthropic.com>
2026-02-28 15:14:33 -08:00