Skip to content

Commit 971eb3c

Browse files
committed
GitHub Desktop from overlay
1 parent bda2fca commit 971eb3c

File tree

5 files changed

+44
-6
lines changed

5 files changed

+44
-6
lines changed

home/default.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
++ lib.optionals stdenv.isDarwin [
6565
chatgpt
6666
daisydisk
67+
github-desktop
6768
gitify
6869
iina
6970
m-cli

lib/hosts.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@
101101
}
102102
{
103103
nixpkgs.overlays = [
104+
(import ./../overlays/github-desktop.nix)
104105
(import ./../overlays/whatsapp-for-mac.nix)
105106
];
106107
}

modules/darwin/default.nix

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@
2121
};
2222
taps = builtins.attrNames config.nix-homebrew.taps; # See: zhaofengli/nix-homebrew#5
2323
casks = let
24-
# Electron apps generally are marked auto_updates
25-
electronApps = [
26-
"github"
27-
];
2824
# Apps marked auto_updates but which have their updates disabled via CustomUserPreferences
2925
greedyApps =
3026
map (name: {
@@ -53,7 +49,6 @@
5349
];
5450
in
5551
lib.concatLists [
56-
electronApps
5752
greedyApps
5853
otherApps
5954
];
@@ -149,7 +144,7 @@
149144
"/System/Applications/Messages.app"
150145
"${pkgs.slack}/Applications/Slack.app"
151146
"/Applications/Textual.app"
152-
"/Applications/GitHub Desktop.app"
147+
"${pkgs.slack}/Applications/GitHub Desktop.app"
153148
];
154149
show-process-indicators = false;
155150
showhidden = false;

overlays/github-desktop.nix

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
self: super: {
2+
github-desktop = super.callPackage ./../packages/github-desktop/package.nix {};
3+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# TODO: Build from source and upstream
2+
{
3+
lib,
4+
stdenvNoCC,
5+
fetchurl,
6+
unzip,
7+
}:
8+
stdenvNoCC.mkDerivation (finalAttrs: {
9+
pname = "github-desktop";
10+
version = "3.4.19";
11+
12+
src = fetchurl {
13+
url = "https://github.com/desktop/desktop/releases/download/release-${finalAttrs.version}/GitHub.Desktop-arm64.zip";
14+
hash = "sha256-ircv8/fWS8JX4fWWxGpFaOSw5uuPZ3JtYenBdU/vlls=";
15+
};
16+
17+
dontUnpack = true;
18+
19+
nativeBuildInputs = [unzip];
20+
21+
installPhase = ''
22+
runHook preInstall
23+
24+
mkdir -p "$out/Applications"
25+
unzip -d "$out/Applications" $src
26+
27+
runHook postInstall
28+
'';
29+
30+
meta = with lib; {
31+
description = "GUI for managing Git and GitHub";
32+
homepage = "https://desktop.github.com/";
33+
license = licenses.mit;
34+
mainProgram = "github-desktop";
35+
platforms = platforms.darwin;
36+
sourceProvenance = with sourceTypes; [binaryNativeCode];
37+
};
38+
})

0 commit comments

Comments
 (0)