gfn-electron: init at 2.1.2 (#353887)

authored by scrumplex.net and committed by GitHub c598a008 fcf7e79c

+80
+80
pkgs/by-name/gf/gfn-electron/package.nix
···
··· 1 + { 2 + lib, 3 + buildNpmPackage, 4 + fetchFromGitHub, 5 + electron, 6 + nix-update-script, 7 + makeBinaryWrapper, 8 + }: 9 + let 10 + version = "2.1.2"; 11 + in 12 + buildNpmPackage { 13 + pname = "gfn-electron"; 14 + inherit version; 15 + 16 + src = fetchFromGitHub { 17 + owner = "hmlendea"; 18 + repo = "gfn-electron"; 19 + rev = "refs/tags/v${version}"; 20 + hash = "sha256-kTnM4wSDqP2V8hb4mDhbQYpVYouSnUkjuuCfITb/xgY="; 21 + }; 22 + 23 + npmDepsHash = "sha256-27N0hWOfkLQGaGspm4aCoVF6PWiUOAKs+JzbdQV94lo="; 24 + 25 + nativeBuildInputs = [ makeBinaryWrapper ]; 26 + 27 + env.ELECTRON_SKIP_BINARY_DOWNLOAD = true; 28 + 29 + # FIXME: Git dependency node_modules/register-scheme contains install scripts, 30 + # but has no lockfile, which is something that will probably break. 31 + forceGitDeps = true; 32 + 33 + makeCacheWritable = true; 34 + 35 + buildPhase = '' 36 + runHook preBuild 37 + 38 + # NOTE: Upstream explicitly opts to not build an ASAR as it would cause all 39 + # text to disappear in the app. 40 + npm exec electron-builder -- \ 41 + --dir \ 42 + -c.electronDist=${electron.dist} \ 43 + -c.electronVersion=${electron.version} 44 + 45 + runHook postBuild 46 + ''; 47 + 48 + installPhase = '' 49 + runHook preInstall 50 + 51 + mkdir -p $out 52 + cp -r dist/*-unpacked $out/dist 53 + 54 + install -Dm644 com.github.hmlendea.geforcenow-electron.desktop -t $out/share/applications 55 + install -Dm644 icon.png $out/share/icons/hicolor/512x512/apps/geforcenow-electron.png 56 + 57 + runHook postInstall 58 + ''; 59 + 60 + postFixup = '' 61 + makeWrapper $out/dist/geforcenow-electron $out/bin/geforcenow-electron \ 62 + --add-flags "--no-sandbox --disable-gpu-sandbox" \ 63 + --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime}}" 64 + 65 + substituteInPlace $out/share/applications/com.github.hmlendea.geforcenow-electron.desktop \ 66 + --replace-fail "/opt/geforcenow-electron/geforcenow-electron" "geforcenow-electron" \ 67 + --replace-fail "Icon=nvidia" "Icon=geforcenow-electron" 68 + ''; 69 + 70 + passthru.updateScript = nix-update-script { }; 71 + 72 + meta = { 73 + description = "Linux Desktop client for Nvidia's GeForce NOW game streaming service"; 74 + homepage = "https://github.com/hmlendea/gfn-electron"; 75 + license = with lib.licenses; [ gpl3Only ]; 76 + platforms = lib.intersectLists lib.platforms.linux electron.meta.platforms; 77 + maintainers = with lib.maintainers; [ pluiedev ]; 78 + mainProgram = "geforcenow-electron"; 79 + }; 80 + }