forked from Admiral-Billy/Pokerogue-App
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.nix
68 lines (56 loc) · 1.67 KB
/
release.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
{ lib
, buildNpmPackage
, makeWrapper
, stdenv
, pname
, version
, src
, npmDepsHash
, electron
}:
buildNpmPackage rec {
inherit pname version src npmDepsHash;
forceGitDeps = true;
env = {
ELECTRON_SKIP_BINARY_DOWNLOAD = 1;
NIXOS_OZONE_WL = 1;
};
dontNpmBuild = true;
NODE_OPTIONS = "--openssl-legacy-provider";
buildInputs = [ electron ];
preConfigure = ''
export NO_UPDATE_NOTIFIER="1"
export ELECTRON_SKIP_BINARY_DOWNLOAD=1
'';
installPhase = ''
runHook preInstall
mkdir -p "$out/bin"
mkdir -p "$out/share/applications"
mkdir -p "$out/share/icons/hicolor/512x512/apps"
cp -r ./* "$out/bin/"
cp "$out/bin/type-chart.png" "$out/bin/src/typechart.png"
cp "$out/bin/type-chart-2.png" "$out/bin/src/typechart-2.png"
cp "$out/bin/icons/PR.png" "$out/share/icons/hicolor/512x512/apps/PR.png"
# Create an executable wrapper
makeWrapper ${electron}/bin/electron "$out/bin/pokerogue" \
--add-flags "$out/bin/src/main.js" \
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}" \
--inherit-argv0
cat > "$out/share/applications/pokerogue-app.desktop" <<EOF
[Desktop Entry]
Name=Pokerogue
Exec=$out/bin/pokerogue
Icon=$out/share/icons/hicolor/512x512/apps/PR.png
Type=Application
Comment=Desktop app for the Pokerogue web game
Categories=Game;
EOF
'';
meta = with lib; {
description = "Desktop app for the Pokerogue web game";
homepage = "https://github.com/Admiral-Billy/Pokerogue-App";
license = licenses.mit;
maintainers = with maintainers; [];
platforms = platforms.linux;
};
}