The native binding now links libpipewire directly, so pipewire moves into buildInputs for autoPatchelf as well. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
143 lines
3.0 KiB
Nix
143 lines
3.0 KiB
Nix
{ lib
|
|
, stdenv
|
|
, fetchurl
|
|
, dpkg
|
|
, autoPatchelfHook
|
|
, makeWrapper
|
|
, wrapGAppsHook3
|
|
, alsa-lib
|
|
, at-spi2-atk
|
|
, at-spi2-core
|
|
, atk
|
|
, cairo
|
|
, cups
|
|
, dbus
|
|
, expat
|
|
, glib
|
|
, gtk3
|
|
, libcap_ng
|
|
, libdrm
|
|
, libgbm
|
|
, libseccomp
|
|
, libxkbcommon
|
|
, nspr
|
|
, nss
|
|
, pango
|
|
, systemd
|
|
, libx11
|
|
, libxcb
|
|
, libxcomposite
|
|
, libxdamage
|
|
, libxext
|
|
, libxfixes
|
|
, libxrandr
|
|
, libxtst
|
|
, libGL
|
|
, libayatana-appindicator
|
|
, libnotify
|
|
, libpulseaudio
|
|
, libsecret
|
|
, pipewire
|
|
, wayland
|
|
, qemu_kvm
|
|
, xdg-utils
|
|
}:
|
|
|
|
# Anthropic's official Linux build (Debian .deb), patchelf'd in place. The
|
|
# bundled Electron binary is kept rather than swapped for nixpkgs' electron:
|
|
# app.asar ships a V8 code cache (compile-cache/*.jsc) tied to that exact build.
|
|
#
|
|
# Cowork looks for qemu on $PATH but for OVMF and virtiofsd only at fixed
|
|
# Debian paths; services/desktop/claude-desktop.nix symlinks those into /usr.
|
|
#
|
|
# Bump: take the highest `Version:` listed in
|
|
# https://downloads.claude.ai/claude-desktop/apt/stable/dists/stable/main/binary-amd64/Packages
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
pname = "claude-desktop";
|
|
version = "2.37337.1";
|
|
|
|
src = fetchurl {
|
|
url = "https://downloads.claude.ai/claude-desktop/apt/stable/pool/main/c/claude-desktop/claude-desktop_${finalAttrs.version}_amd64.deb";
|
|
hash = "sha256-QXRbCRTw/1FjGh/xu0A7g2v1yZWEXMpnQt05vKOi2hQ=";
|
|
};
|
|
|
|
nativeBuildInputs = [ dpkg autoPatchelfHook makeWrapper wrapGAppsHook3 ];
|
|
|
|
buildInputs = [
|
|
alsa-lib
|
|
at-spi2-atk
|
|
at-spi2-core
|
|
atk
|
|
cairo
|
|
cups
|
|
dbus
|
|
expat
|
|
glib
|
|
gtk3
|
|
libcap_ng # bundled virtiofsd
|
|
libdrm
|
|
libgbm
|
|
libseccomp # bundled virtiofsd
|
|
libxkbcommon
|
|
nspr
|
|
nss
|
|
pango
|
|
pipewire # claude-native-binding.node
|
|
stdenv.cc.cc.lib # node-pty
|
|
systemd
|
|
libx11
|
|
libxcb
|
|
libxcomposite
|
|
libxdamage
|
|
libxext
|
|
libxfixes
|
|
libxrandr
|
|
libxtst
|
|
];
|
|
|
|
# dlopen'd by Chromium, so not in any DT_NEEDED.
|
|
runtimeDependencies = [
|
|
libGL
|
|
libayatana-appindicator
|
|
libnotify
|
|
libpulseaudio
|
|
libsecret
|
|
pipewire
|
|
systemd
|
|
wayland
|
|
];
|
|
|
|
dontWrapGApps = true;
|
|
|
|
installPhase = ''
|
|
runHook preInstall
|
|
|
|
mkdir -p $out/lib $out/bin
|
|
cp -r usr/lib/claude-desktop $out/lib/
|
|
cp -r usr/share $out/share
|
|
rm -r $out/share/lintian
|
|
|
|
# Setuid is impossible in the store; Chromium falls back to its userns sandbox.
|
|
rm $out/lib/claude-desktop/chrome-sandbox
|
|
|
|
runHook postInstall
|
|
'';
|
|
|
|
postFixup = ''
|
|
# Chromium doesn't recognise Hyprland, falls back to basic_text, and logins don't persist.
|
|
makeWrapper $out/lib/claude-desktop/claude-desktop $out/bin/claude-desktop \
|
|
"''${gappsWrapperArgs[@]}" \
|
|
--add-flags "--password-store=gnome-libsecret" \
|
|
--prefix PATH : ${lib.makeBinPath [ qemu_kvm xdg-utils ]}
|
|
'';
|
|
|
|
meta = {
|
|
description = "Desktop application for Claude.ai";
|
|
homepage = "https://claude.ai";
|
|
license = lib.licenses.unfree;
|
|
sourceProvenance = [ lib.sourceTypes.binaryNativeCode ];
|
|
platforms = [ "x86_64-linux" ];
|
|
mainProgram = "claude-desktop";
|
|
};
|
|
})
|