1{ stdenv
2, lib
3, fetchurl
4, autoPatchelfHook
5, wrapGAppsHook
6, makeWrapper
7, gnome
8, libsecret
9, git
10, curl
11, nss
12, nspr
13, xorg
14, libdrm
15, alsa-lib
16, cups
17, mesa
18, systemd
19, openssl
20}:
21
22stdenv.mkDerivation (finalAttrs: {
23 pname = "github-desktop";
24 version = "3.2.5";
25
26 src = fetchurl {
27 url = "https://github.com/shiftkey/desktop/releases/download/release-${finalAttrs.version}-linux1/GitHubDesktop-linux-${finalAttrs.version}-linux1.deb";
28 hash = "sha256-p+qr9/aEQcfkKArC3oTyIijHkaNzLum3xXeSnNexgbU=";
29 };
30
31 nativeBuildInputs = [
32 autoPatchelfHook
33 (wrapGAppsHook.override { inherit makeWrapper; })
34 ];
35
36 buildInputs = [
37 gnome.gnome-keyring
38 xorg.libXdamage
39 xorg.libX11
40 libsecret
41 git
42 curl
43 nss
44 nspr
45 libdrm
46 alsa-lib
47 cups
48 mesa
49 openssl
50 ];
51
52 unpackPhase = ''
53 mkdir -p $TMP/${finalAttrs.pname} $out/{opt,bin}
54 cp $src $TMP/${finalAttrs.pname}.deb
55 ar vx ${finalAttrs.pname}.deb
56 tar --no-overwrite-dir -xvf data.tar.xz -C $TMP/${finalAttrs.pname}/
57 '';
58
59 installPhase = ''
60 cp -R $TMP/${finalAttrs.pname}/usr/share $out/
61 cp -R $TMP/${finalAttrs.pname}/usr/lib/${finalAttrs.pname}/* $out/opt/
62 ln -sf $out/opt/${finalAttrs.pname} $out/bin/${finalAttrs.pname}
63 '';
64
65 preFixup = ''
66 gappsWrapperArgs+=(
67 --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform=wayland}}"
68 )
69 '';
70
71 runtimeDependencies = [
72 (lib.getLib systemd)
73 ];
74
75 meta = {
76 description = "GUI for managing Git and GitHub.";
77 homepage = "https://desktop.github.com/";
78 sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
79 license = lib.licenses.mit;
80 maintainers = with lib.maintainers; [ dan4ik605743 ];
81 platforms = lib.platforms.linux;
82 };
83})