nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at python-updates 78 lines 2.2 kB view raw
1{ 2 lib, 3 buildNpmPackage, 4 fetchFromGitHub, 5 nodejs_24, 6 makeWrapper, 7 electron, 8 copyDesktopItems, 9 makeDesktopItem, 10}: 11 12buildNpmPackage (finalAttrs: { 13 pname = "thorium-reader"; 14 version = "3.3.0"; 15 nodejs = nodejs_24; 16 npmDepsHash = "sha256-UR2MSqmdJ79Fz7qjQRkCAwx2jdMn8KLWPzNSnnsb5Ak="; 17 makeCacheWritable = true; 18 19 src = fetchFromGitHub { 20 owner = "edrlab"; 21 repo = "thorium-reader"; 22 tag = "v${finalAttrs.version}"; 23 hash = "sha256-2d5M9C/cLK2A8O3Ls0xEkT6H8tucVR7eivPi+82V7Zg="; 24 }; 25 26 env.ELECTRON_SKIP_BINARY_DOWNLOAD = "1"; 27 28 nativeBuildInputs = [ 29 makeWrapper 30 copyDesktopItems 31 ]; 32 33 postInstall = '' 34 install -Dpm644 resources/icon.png $out/share/icons/hicolor/1024x1024/apps/thorium-reader.png 35 36 cp -r dist/* $out/lib/node_modules/EDRLab.ThoriumReader/ 37 38 makeWrapper '${lib.getExe electron}' "$out/bin/thorium-reader" \ 39 --add-flags $out/lib/node_modules/EDRLab.ThoriumReader \ 40 --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}" \ 41 --set-default ELECTRON_IS_DEV 0 \ 42 --inherit-argv0 43 ''; 44 45 desktopItems = [ 46 (makeDesktopItem { 47 name = "thorium-reader"; 48 desktopName = "Thorium"; 49 exec = "thorium-reader %u"; 50 terminal = false; 51 type = "Application"; 52 icon = "thorium-reader"; 53 startupWMClass = "thorium-reader"; 54 mimeTypes = [ 55 "application/epub+zip" 56 "application/daisy+zip" 57 "application/vnd.readium.lcp.license.v1.0+json" 58 "application/audiobook+zip" 59 "application/webpub+zip" 60 "application/audiobook+lcp" 61 "application/pdf+lcp" 62 "x-scheme-handler/thorium" 63 "x-scheme-handler/opds" 64 ]; 65 comment = "Desktop application to read ebooks"; 66 categories = [ "Office" ]; 67 }) 68 ]; 69 70 meta = { 71 description = "EPUB reader"; 72 homepage = "https://www.edrlab.org/software/thorium-reader/"; 73 license = lib.licenses.bsd3; 74 maintainers = with lib.maintainers; [ YodaDaCoda ]; 75 platforms = lib.platforms.all; 76 mainProgram = "thorium-reader"; 77 }; 78})