feat: add gitbutler cli

This commit is contained in:
johannes committed 2026-10-01 22:48:11 +02:00
1 parent 735bb46016
commit c445f239aa
3 files changed
+72

No files matched your search

+1
View File
@@ -16,6 +16,7 @@ Managed via Home Manager (`home.nix`). Applied using `./apply.sh`.
**CLI Utilities**
- `neovim` - Editor
- `git`, `lazygit` - Version control
- `but` - GitButler CLI (`pkgs/but.nix`, pinned; bump version/hashes by hand)
- `ripgrep` (`rg`), `fd` - Fast search
- `pay-respects` - Command correction (`f`)
- `sops`, `age` - Secret management
+1
View File
@@ -43,6 +43,7 @@
starship
zoxide
lazygit
(callPackage ./pkgs/but.nix { })
fastfetch
eza
atuin
+70
View File
@@ -0,0 +1,70 @@
# GitButler CLI (`but`). nixpkgs `gitbutler` is GUI-only and builds from source.
# ponytail: pinned by hand; bump `version`, `build`, and both hashes (see releases JSON at
# https://app.gitbutler.com/releases/version/<version>) to upgrade.
{
lib,
stdenvNoCC,
fetchurl,
autoPatchelfHook,
dbus,
zlib,
stdenv,
}:
let
version = "0.22.3";
build = "3234";
base = "https://releases.gitbutler.com/releases/release/${version}-${build}";
isDarwin = stdenvNoCC.hostPlatform.isDarwin;
src =
if isDarwin then
fetchurl {
url = "${base}/macos/aarch64/GitButler.app.tar.gz";
hash = "sha256-7fD2gMEC/4b67h2RnqKmFm/L5uOpiYZwbJGjju1mL3Q=";
}
else
fetchurl {
url = "${base}/linux/x86_64/but";
hash = "sha256-P09UOmzNkxzmyGxIQFjb5eKUOVl9AB9qCpwo2eUz6hg=";
};
in
stdenvNoCC.mkDerivation {
pname = "but";
inherit version src;
sourceRoot = ".";
unpackPhase = if isDarwin then "tar xzf $src" else "true";
nativeBuildInputs = lib.optional (!isDarwin) autoPatchelfHook;
buildInputs = lib.optionals (!isDarwin) [
dbus
zlib
stdenv.cc.cc.lib
];
# Re-signing/stripping would break the app's code signature on macOS.
dontFixup = isDarwin;
installPhase =
if isDarwin then
''
mkdir -p $out/Applications $out/bin
cp -r GitButler.app $out/Applications/
# the app binary acts as the CLI when invoked as `but`
ln -s $out/Applications/GitButler.app/Contents/MacOS/gitbutler-tauri $out/bin/but
''
else
''
install -Dm755 $src $out/bin/but
'';
meta = {
description = "GitButler CLI";
homepage = "https://gitbutler.com";
license = lib.licenses.fsl11Mit;
mainProgram = "but";
platforms = [
"aarch64-darwin"
"x86_64-linux"
];
};
}