27 rustPlatform.buildRustPackage rec {
31 src = fetchFromGitHub {
32 owner = "gitbutlerapp";
34 rev = "release/${version}";
35 hash = "sha256-L4PVaNb3blpLIcyA7XLc71qwUPUADclxvbOkq1Jc1no=";
38 # deactivate the upstream updater in tauri configuration & set the version
40 tauri_conf="crates/gitbutler-tauri/tauri.conf.release.json"
41 jq '.package.version = "${version}" | .tauri.updater.active = false' "$tauri_conf" | sponge "$tauri_conf"
45 lockFile = ./Cargo.lock;
47 "tauri-plugin-context-menu-0.7.1" = "sha256-vKfq20hrFLmfoXO94D8HwAE3UdGcuqVZf3+tOBhLqj0=";
48 "tauri-plugin-log-0.0.0" = "sha256-gde2RS5NFA0Xap/Xb7XOeVQ/5t2Nw+j+HOwfeJmSNMU=";
52 pnpmDeps = pnpm_9.fetchDeps {
53 inherit pname version src;
54 hash = "sha256-r2PkNDvOofginL5Y0K+7Qhnsev2zle1q9qraG/ub7Wo=";
71 ++ lib.optionals stdenv.hostPlatform.isLinux [
76 ++ lib.optionals stdenv.hostPlatform.isDarwin (
77 with darwin.apple_sdk.frameworks;
86 # extended release configuration
87 tauriBuildFlags = [ "--config crates/gitbutler-tauri/tauri.conf.release.json" ];
90 # make sure `crates/gitbutler-tauri/inject-git-binaries.sh` can find our
92 # https://github.com/gitbutlerapp/gitbutler/blob/56b64d778042d0e93fa362f808c35a7f095ab1d1/crates/gitbutler-tauri/inject-git-binaries.sh#L10C10-L10C26
93 TRIPLE_OVERRIDE = rust.envVars.rustHostPlatformSpec;
95 # `pnpm`'s `fetchDeps` and `configHook` uses a specific version of pnpm, not upstream's
96 COREPACK_ENABLE_STRICT = 0;
98 # disable turbo telemetry
99 TURBO_TELEMETRY_DEBUG = 1;
101 # we depend on nightly features
104 # we also need to have `tracing` support in `tokio` for `console-subscriber`
105 RUSTFLAGS = "--cfg tokio_unstable";
107 ESBUILD_BINARY_PATH = lib.getExe (
115 src = fetchFromGitHub {
119 hash = "sha256-h/Vqwax4B4nehRP9TaYbdixAZdb1hx373dNxNHvDrtY=";
122 vendorHash = "sha256-+BfxCyg0KkDQpHt/wycy/8CTG6YBA/VJvJFhhzUnSiQ=";
128 # Needed to get openssl-sys to use pkgconfig.
129 OPENSSL_NO_VENDOR = true;
139 lib.optionalString stdenv.hostPlatform.isDarwin ''
140 mv $out/Applications/GitButler.app/Contents/MacOS/GitButler $out/bin/git-butler
141 ln -s $out/bin/git-butler $out/Applications/GitButler.app/Contents/MacOS/GitButler
143 + lib.optionalString stdenv.hostPlatform.isLinux ''
145 --set-comment "A Git client for simultaneous branches on top of your existing workflow." \
146 --set-key="Keywords" --set-value="git;" \
147 --set-key="StartupWMClass" --set-value="GitButler" \
148 $out/share/applications/git-butler.desktop
151 # the `gitbutler-git` crate's checks do not support release mode
154 nativeCheckInputs = [ git ];
157 updateScript = nix-update-script {
166 description = "Git client for simultaneous branches on top of your existing workflow";
167 homepage = "https://gitbutler.com";
168 changelog = "https://github.com/gitbutlerapp/gitbutler/releases/tag/release/${version}";
169 mainProgram = "git-butler";
170 license = lib.licenses.fsl11Mit;
171 maintainers = with lib.maintainers; [
175 platforms = lib.platforms.linux ++ lib.platforms.darwin;