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