depot/third_party/nixpkgs/pkgs/applications/version-management/github-desktop/default.nix
Default email c7e6337bd0 Project import generated by Copybara.
GitOrigin-RevId: 08e4dc3a907a6dfec8bb3bbf1540d8abbffea22b
2023-04-29 12:46:19 -04:00

83 lines
1.6 KiB
Nix

{ stdenv
, lib
, fetchurl
, autoPatchelfHook
, wrapGAppsHook
, makeWrapper
, gnome
, libsecret
, git
, curl
, nss
, nspr
, xorg
, libdrm
, alsa-lib
, cups
, mesa
, systemd
, openssl
}:
stdenv.mkDerivation rec {
pname = "github-desktop";
version = "3.2.1";
src = fetchurl {
url = "https://github.com/shiftkey/desktop/releases/download/release-${version}-linux1/GitHubDesktop-linux-${version}-linux1.deb";
hash = "sha256-OdvebRvOTyadgNjzrv6CGDPkljfpo4RVvVAc+X9hjSo=";
};
nativeBuildInputs = [
autoPatchelfHook
(wrapGAppsHook.override { inherit makeWrapper; })
];
buildInputs = [
gnome.gnome-keyring
xorg.libXdamage
xorg.libX11
libsecret
git
curl
nss
nspr
libdrm
alsa-lib
cups
mesa
openssl
];
unpackPhase = ''
mkdir -p $TMP/${pname} $out/{opt,bin}
cp $src $TMP/${pname}.deb
ar vx ${pname}.deb
tar --no-overwrite-dir -xvf data.tar.xz -C $TMP/${pname}/
'';
installPhase = ''
cp -R $TMP/${pname}/usr/share $out/
cp -R $TMP/${pname}/usr/lib/${pname}/* $out/opt/
ln -sf $out/opt/${pname} $out/bin/${pname}
'';
preFixup = ''
gappsWrapperArgs+=(
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform=wayland}}"
)
'';
runtimeDependencies = [
(lib.getLib systemd)
];
meta = with lib; {
description = "GUI for managing Git and GitHub.";
homepage = "https://desktop.github.com/";
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
license = licenses.mit;
maintainers = with maintainers; [ dan4ik605743 ];
platforms = platforms.linux;
};
}