From 6885cfbb04aa0f690b4bfb469ab8fe58f98b55bc Mon Sep 17 00:00:00 2001 From: huantian Date: Sun, 6 Nov 2022 17:49:35 -0700 Subject: [PATCH] tetrio-desktop: add tetrio-plus option --- pkgs/games/tetrio-desktop/default.nix | 7 ++++++ pkgs/games/tetrio-desktop/tetrio-plus.nix | 27 +++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 pkgs/games/tetrio-desktop/tetrio-plus.nix diff --git a/pkgs/games/tetrio-desktop/default.nix b/pkgs/games/tetrio-desktop/default.nix index 66480855547a..221f0160ca95 100644 --- a/pkgs/games/tetrio-desktop/default.nix +++ b/pkgs/games/tetrio-desktop/default.nix @@ -13,6 +13,9 @@ , gtk3 , libpulseaudio , systemd +, callPackage +, withTetrioPlus ? false +, tetrio-plus ? callPackage ./tetrio-plus.nix { } }: stdenv.mkDerivation rec { @@ -67,6 +70,10 @@ stdenv.mkDerivation rec { runHook postInstall ''; + postInstall = lib.strings.optionalString withTetrioPlus '' + cp ${tetrio-plus} $out/opt/TETR.IO/resources/app.asar + ''; + postFixup = '' wrapProgram $out/opt/TETR.IO/tetrio-desktop \ --prefix LD_LIBRARY_PATH : ${libPath}:$out/opt/TETR.IO \ diff --git a/pkgs/games/tetrio-desktop/tetrio-plus.nix b/pkgs/games/tetrio-desktop/tetrio-plus.nix new file mode 100644 index 000000000000..e8daf4d0fbe9 --- /dev/null +++ b/pkgs/games/tetrio-desktop/tetrio-plus.nix @@ -0,0 +1,27 @@ +{ lib, stdenv, fetchzip }: + +stdenv.mkDerivation rec { + pname = "tetrio-plus"; + version = "0.23.13"; + + src = fetchzip { + url = "https://gitlab.com/UniQMG/tetrio-plus/uploads/a9647feffc484304ee49c4d3fd4ce718/tetrio-plus_0.23.13_app.asar.zip"; + sha256 = "sha256-NSOVZjm4hDXH3f0gFG8ijLmdUTyMRFYGhxpwysoYIVg="; + }; + + installPhase = '' + runHook preInstall + + install app.asar $out + + runHook postInstall + ''; + + meta = with lib; { + description = "TETR.IO customization toolkit"; + homepage = "https://gitlab.com/UniQMG/tetrio-plus"; + license = licenses.mit; + maintainers = with maintainers; [ huantian ]; + platforms = [ "x86_64-linux" ]; + }; +}