Skip to content

Instantly share code, notes, and snippets.

@ink-splatters
Created January 29, 2026 05:32
Show Gist options
  • Select an option

  • Save ink-splatters/da40a341df14914091af5b1a66fb7f0b to your computer and use it in GitHub Desktop.

Select an option

Save ink-splatters/da40a341df14914091af5b1a66fb7f0b to your computer and use it in GitHub Desktop.
{
fetchurl,
makeWrapper,
stdenvNoCC,
}: let
meta-info = builtins.fromJSON (builtins.readFile ./meta-info.json);
inherit (meta-info) platforms version;
platform = let
inherit (stdenvNoCC.hostPlatform) darwinArch linuxArch;
in
if stdenvNoCC.isDarwin
then "darwin-${darwinArch}"
else if stdenvNoCC.isLinux
then "linux-${linuxArch}"
else "unknown";
in
assert (platform != "unknown");
stdenvNoCC.mkDerivation {
pname = "claude-code";
inherit version;
src = fetchurl {
inherit (platforms."${platform}") url sha256;
};
dontUnpack = true;
nativeBuildInputs = [makeWrapper];
installPhase = ''
runHook preInstall
install -Dm755 $src $out/bin/claude
runHook postInstall
'';
# TODO: find a way to disable automatic installation to ~/.local
postInstall = ''
wrapProgram $out/bin/claude \
--set DISABLE_AUTOUPDATER 1 \
--unset DEV
'';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment