16 src = fetchFromGitHub {
17 owner = "sindresorhus";
20 hash = "sha256-yfCilJ62m7nKe8B+4puwAbNgr2g1P7HaKIhFINdv0/k=";
23 ELECTRON_SKIP_BINARY_DOWNLOAD = "1";
25 npmDepsHash = "sha256-hNOAplCSXrO4NZqDTkmhf0oZVeGRUHr2Y/Qdx2RIV9c=";
27 nativeBuildInputs = [ copyDesktopItems ];
30 cp -r ${electron.dist} electron-dist
31 chmod -R u+w electron-dist
33 npm exec electron-builder -- \
36 -c.asarUnpack="**/*.node" \
37 -c.electronDist=electron-dist \
38 -c.electronVersion=${electron.version}
41 patches = [ ./001-disable-auto-update.patch ];
46 ${lib.optionalString stdenv.hostPlatform.isLinux ''
47 mkdir -p $out/share/caprine
48 cp -r dist/*-unpacked/{locales,resources{,.pak}} $out/share/caprine
50 makeWrapper ${lib.getExe electron} $out/bin/caprine \
51 --add-flags $out/share/caprine/resources/app.asar \
52 --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}" \
53 --set-default ELECTRON_IS_DEV 0 \
56 install -Dm644 build/icon.png $out/share/icons/hicolor/512x512/apps/caprine.png
59 ${lib.optionalString stdenv.hostPlatform.isDarwin ''
60 mkdir -p $out/Applications
61 cp -r dist/mac*/"Caprine.app" $out/Applications
62 makeWrapper "$out/Applications/Caprine.app/Contents/MacOS/Caprine" $out/bin/caprine
73 desktopName = "Caprine";
74 comment = meta.description;
80 mimeTypes = [ "x-scheme-handler/caprine" ];
85 passthru.updateScript = nix-update-script { };
88 changelog = "https://github.com/sindresorhus/caprine/releases/tag/${src.rev}";
89 description = "Elegant Facebook Messenger desktop app";
90 homepage = "https://github.com/sindresorhus/caprine";
91 license = lib.licenses.mit;
92 maintainers = with lib.maintainers; [
96 inherit (electron.meta) platforms;