Created
February 7, 2025 04:34
-
-
Save edef1c/bac094868ca7b4b6c906272e29f8ef87 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
lib, | |
stdenv, | |
fetchurl, | |
p7zip, | |
libarchive, | |
asar, | |
electron_33, | |
makeWrapper, | |
}: | |
stdenv.mkDerivation rec { | |
pname = "claude-desktop"; | |
version = "0.7.8"; | |
src = fetchurl { | |
url = "https://storage.googleapis.com/osprey-downloads-c02f6a0d-347c-492b-a752-3e0651722e97/nest-win-x64/Claude-Setup-x64.exe"; | |
hash = "sha256-SOO1FkAfcOP50Z4YPyrrpSIi322gQdy9vk0CKdYjMwA="; | |
}; | |
nativeBuildInputs = [ | |
p7zip | |
libarchive | |
asar | |
makeWrapper | |
]; | |
unpackPhase = '' | |
7z x $src AnthropicClaude-${version}-full.nupkg | |
bsdtar xf AnthropicClaude-${version}-full.nupkg --strip-components=3 lib/net45/resources/app.asar{,.unpacked} | |
asar e app.asar app | |
sourceRoot=app | |
''; | |
postPatch = '' | |
rm node_modules/claude-native/claude-native-binding.node | |
echo "module.exports={KeyboardKey:{}}" > node_modules/claude-native/index.js | |
''; | |
installPhase = '' | |
mkdir -p $out | |
asar pack . $out/app.asar | |
makeWrapper ${lib.getExe electron_33} $out/bin/claude-desktop --add-flags $out/app.asar | |
''; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment