Skip to content

Instantly share code, notes, and snippets.

@DataHearth
Created May 2, 2024 12:23
Show Gist options
  • Save DataHearth/d0c7e3f03cfa550aaa58a89d1d5e745f to your computer and use it in GitHub Desktop.
Save DataHearth/d0c7e3f03cfa550aaa58a89d1d5e745f to your computer and use it in GitHub Desktop.
{ lib
, stdenv
, fetchurl
, fetchzip
, appimageTools
, undmg
}:
let
pname = "git-butler";
version = "0.11.5";
build_version = "864";
src = {
x86_64-darwin = fetchurl {
url = "https://releases.gitbutler.com/releases/release/${version}-${build_version}/macos/x86_64/GitButler_${version}_x64.dmg";
hash = lib.fakeSha256;
};
aarch64-darwin = fetchurl {
url = "https://releases.gitbutler.com/releases/release/${version}-${build_version}/macos/aarch64/GitButler_${version}_aarch64.dmg";
hash = "sha256-e9VT7LDqi4X3qsCR+1icWROoBkDExiNFmHDSaxt0yLQ=";
};
x86_64-linux = fetchzip {
url = "https://releases.gitbutler.com/releases/release/${version}-${build_version}/linux/x86_64/git-butler_${version}_amd64.AppImage.tar.gz";
hash = "sha256-7n0DlJjt1RW88lQhSCI1JVRdQNT8+M5M8kPOHXkDoUA=";
};
}.${stdenv.system} or (throw "Unsupported system: ${stdenv.system}");
meta = {
description = "A Git client for simultaneous branches on top of your existing workflow.";
mainProgram = "git-butler";
homepage = "https://gitbutler.com/";
changelog = "https://discord.com/channels/1060193121130000425/1183737922785116161";
platforms = [ "aarch64-darwin" "x86_64-darwin" "x86_64-linux" ];
license = lib.licenses.fsl11Mit;
maintainers = with lib.maintainers; [ DataHearth ];
};
in
if stdenv.isDarwin then stdenv.mkDerivation
{
...
}
else appimageTools.wrapType2 {
inherit pname version src meta;
extraPkgs = pkgs:
appimageTools.defaultFhsEnvArgs.multiPkgs pkgs;
extraInstallCommands =
let
appimageContents = appimageTools.extractType2 { inherit pname version src; };
in
''
# Install .desktop files
install -Dm444 ${appimageContents}/git-butler.desktop -t $out/share/applications
install -Dm444 ${appimageContents}/git-butler.png -t $out/share/pixmaps
'';
}
@DataHearth
Copy link
Author

Logs:

these 8 derivations will be built:
  /nix/store/vbrm3zk078vk5l4zlxgg91xcam4mmgkv-profile.drv
  /nix/store/49psrfzh9j6nf88gp5k99srsvhfimbfd-git-butler-0.11.5-chrootenv-etc.drv
  /nix/store/r11fmrv1mkk2k9sdbbdq2wzjibyal356-git-butler-0.11.5-extracted.drv
  /nix/store/7i2lgn09415nl2dvkn1vgamc62i0f9sg-git-butler-0.11.5-init.drv
  /nix/store/aqrgjxwgl1mpax5f8viin0rik6h299v6-git-butler-0.11.5-usr-target.drv
  /nix/store/nlzdyqzhqj3v88zrllh8sardfhq2vvz3-git-butler-0.11.5-fhs.drv
  /nix/store/lfql1q9i4yk98p5n63hi67xxf8xy48w8-git-butler-0.11.5-bwrap.drv
  /nix/store/4a00c12qy1i3ss1lbxass00p4iz4rbqk-git-butler-0.11.5.drv
building '/nix/store/r11fmrv1mkk2k9sdbbdq2wzjibyal356-git-butler-0.11.5-extracted.drv'...
building '/nix/store/vbrm3zk078vk5l4zlxgg91xcam4mmgkv-profile.drv'...
error: builder for '/nix/store/r11fmrv1mkk2k9sdbbdq2wzjibyal356-git-butler-0.11.5-extracted.drv' failed to produce output path for output 'out' at '/nix/store/r11fmrv1mkk2k9sdbbdq2wzjibyal356-git-butler-0.11.5-extracted.drv.chroot/nix/store/wp2f55j5z2x0aa0qviz646akx7rwm0j3-git-butler-0.11.5-extracted'
error: 1 dependencies of derivation '/nix/store/4a00c12qy1i3ss1lbxass00p4iz4rbqk-git-butler-0.11.5.drv' failed to build```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment