12 stdenv.mkDerivation rec {
16 src = fetchFromGitHub {
18 repo = "whalebird-desktop";
20 hash = "sha256-Jf+vhsfVjNrxdBkwwh3D3d2AlsGHfmEn90dq2QrKi2k=";
22 # we cannot use fetchYarnDeps because that doesn't support yarn 2/berry lockfiles
23 offlineCache = stdenv.mkDerivation {
24 name = "whalebird-${version}-offline-cache";
28 cacert # needed for git
29 gitMinimal # needed to download git dependencies
34 export HOME=$(mktemp -d)
35 yarn config set enableTelemetry 0
36 yarn config set cacheFolder $out
37 yarn config set --json supportedArchitectures.os '[ "linux" ]'
38 yarn config set --json supportedArchitectures.cpu '[ "arm64", "x64" ]'
42 outputHashMode = "recursive";
43 outputHash = "sha256-SJCJq1vkO/jH9YgB3rV/pK4wV5Prm3sNjOj9YwL6XTw=";
54 desktopName = "Whalebird";
55 comment = meta.description;
56 categories = [ "Network" ];
63 ELECTRON_SKIP_BINARY_DOWNLOAD = "1";
68 export HOME=$(mktemp -d)
69 yarn config set enableTelemetry 0
70 yarn config set cacheFolder ${offlineCache}
72 yarn --immutable-cache
73 yarn run nextron build --no-pack
74 yarn run electron-builder --dir \
75 --config electron-builder.yml \
76 -c.electronDist="${electron.dist}" \
77 -c.electronVersion=${electron.version}
86 cp -r ./dist/*-unpacked $out/opt/Whalebird
89 # Taken from https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=whalebird#n41
90 for i in 16 32 128 256 512; do
91 install -Dm644 "resources/icons/icon.iconset/icon_$i"x"$i.png" \
92 "$out/share/icons/hicolor/$i"x"$i/apps/whalebird.png"
94 install -Dm644 "resources/icons/icon.iconset/icon_32x32@2x.png" \
95 "$out/share/icons/hicolor/64x64/apps/whalebird.png"
97 makeWrapper "${electron}/bin/electron" "$out/bin/whalebird" \
98 --add-flags "$out/opt/Whalebird/resources/app.asar" \
99 --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}"
105 description = "Single-column Fediverse client for desktop";
106 mainProgram = "whalebird";
107 homepage = "https://whalebird.social";
108 changelog = "https://github.com/h3poteto/whalebird-desktop/releases/tag/v${version}";
109 license = licenses.gpl3Only;
110 maintainers = with maintainers; [ weathercold ];
111 platforms = [ "x86_64-linux" "aarch64-linux" ];