feat(terra): Claude Desktop with Cowork
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -18,6 +18,7 @@ in
|
||||
../../services/monitoring/node-exporter.nix
|
||||
../../services/desktop/desktop-hyprland.nix
|
||||
../../services/desktop/desktop-apps.nix
|
||||
../../services/desktop/claude-desktop.nix
|
||||
../../services/desktop/librechat.nix
|
||||
../../services/desktop/luna-voice.nix
|
||||
];
|
||||
|
||||
@@ -0,0 +1,139 @@
|
||||
{ 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.7032.0";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://downloads.claude.ai/claude-desktop/apt/stable/pool/main/c/claude-desktop/claude-desktop_${finalAttrs.version}_amd64.deb";
|
||||
hash = "sha256-Hn9FBLylsvay08QSPRRdcnZH538u4tBGhQcR5h59exE=";
|
||||
};
|
||||
|
||||
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
|
||||
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 = ''
|
||||
makeWrapper $out/lib/claude-desktop/claude-desktop $out/bin/claude-desktop \
|
||||
"''${gappsWrapperArgs[@]}" \
|
||||
--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";
|
||||
};
|
||||
})
|
||||
@@ -0,0 +1,20 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
let
|
||||
claude-desktop = pkgs.callPackage ../../pkgs/claude-desktop.nix { };
|
||||
in
|
||||
|
||||
# Claude Desktop, including Cowork (a QEMU/KVM VM the app runs agent tasks in).
|
||||
{
|
||||
environment.systemPackages = [ claude-desktop ];
|
||||
|
||||
# The app only probes these Debian paths, never $PATH or an env var.
|
||||
systemd.tmpfiles.rules = [
|
||||
"L+ /usr/share/OVMF/OVMF_CODE_4M.fd - - - - ${pkgs.OVMF.fd}/FV/OVMF_CODE.fd"
|
||||
"L+ /usr/share/OVMF/OVMF_VARS_4M.fd - - - - ${pkgs.OVMF.fd}/FV/OVMF_VARS.fd"
|
||||
"L+ /usr/libexec/virtiofsd - - - - ${claude-desktop}/lib/claude-desktop/resources/virtiofsd"
|
||||
];
|
||||
|
||||
boot.kernelModules = [ "vhost_vsock" ];
|
||||
users.users.darman.extraGroups = [ "kvm" ];
|
||||
}
|
||||
@@ -16,6 +16,7 @@ in
|
||||
"steam-unwrapped"
|
||||
"steam-run"
|
||||
"claude-code"
|
||||
"claude-desktop" # services/desktop/claude-desktop.nix
|
||||
"proton-pass-cli"
|
||||
"vivaldi"
|
||||
"mongodb" # librechat's local db (services/desktop/librechat.nix) — SSPL
|
||||
|
||||
Reference in New Issue
Block a user