12 stdenv.mkDerivation rec {
15 version = "0.2.0-beta.2";
17 src = fetchFromGitHub {
21 hash = "sha256-7KSPZj9QG6zksji/eY8jczBDHr/9tStlw26LKVqXTAw=";
31 pnpmDeps = pnpm.fetchDeps {
32 inherit pname version src;
33 hash = "sha256-FzMjN0rIjYxexf6tix4qi3mnuPkadjKihhN0Pj5y2nU=";
37 ELECTRON_SKIP_BINARY_DOWNLOAD = "1";
39 # This environment variables inject the production Vite config at build time.
41 # 1. https://github.com/RSSNext/Follow/blob/v0.2.0-beta.2/.github/workflows/build.yml#L18
42 # 2. And logs in the corresponding GitHub Actions: https://github.com/RSSNext/Follow/actions/workflows/build.yml
43 VITE_WEB_URL = "https://app.follow.is";
44 VITE_API_URL = "https://api.follow.is";
45 VITE_IMGPROXY_URL = "https://thumbor.follow.is";
46 VITE_SENTRY_DSN = "https://e5bccf7428aa4e881ed5cb713fdff181@o4507542488023040.ingest.us.sentry.io/4507570439979008";
47 VITE_OPENPANEL_CLIENT_ID = "0e477ab4-d92d-4d6e-b889-b09d86ab908e";
48 VITE_OPENPANEL_API_URL = "https://openpanel.follow.is/api";
49 VITE_FIREBASE_CONFIG = builtins.toJSON {
50 apiKey = "AIzaSyDuM93019tp8VI7wsszJv8ChOs7b1EE5Hk";
51 authDomain = "follow-428106.firebaseapp.com";
52 projectId = "follow-428106";
53 storageBucket = "follow-428106.appspot.com";
54 messagingSenderId = "194977404578";
55 appId = "1:194977404578:web:1920bb0c9ea5e2373669fb";
56 measurementId = "G-SJE57D4F14";
60 desktopItem = makeDesktopItem {
62 desktopName = "Follow";
63 comment = "Next generation information browser";
66 categories = [ "Utility" ];
67 mimeTypes = [ "x-scheme-handler/follow" ];
70 icon = src + "/resources/icon.png";
75 pnpm --offline electron-vite build
76 # Remove dev dependencies.
77 pnpm --ignore-scripts prune --prod
78 # Clean up broken symlinks left behind by `pnpm prune`
79 find node_modules/.bin -xtype l -delete
87 mkdir -p $out/share/{applications,follow}
88 cp -r . $out/share/follow
89 rm -rf $out/share/follow/{.vscode,.github}
91 makeWrapper "${electron}/bin/electron" "$out/bin/follow" \
93 --add-flags --disable-gpu-compositing \
94 --add-flags $out/share/follow \
95 --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime}}"
97 install -m 444 -D "${desktopItem}/share/applications/"* \
98 -t $out/share/applications/
100 for size in 16 24 32 48 64 128 256 512; do
101 mkdir -p $out/share/icons/hicolor/"$size"x"$size"/apps
102 convert -background none -resize "$size"x"$size" ${icon} $out/share/icons/hicolor/"$size"x"$size"/apps/follow.png
109 description = "Next generation information browser";
110 homepage = "https://github.com/RSSNext/Follow";
111 license = lib.licenses.gpl3Only;
112 maintainers = with lib.maintainers; [ iosmanthus ];
113 platforms = [ "x86_64-linux" ];
114 mainProgram = "follow";