Files
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

69 lines
2.0 KiB
Nix

{
stdenv,
lib,
fetchzip,
dpkg,
makeWrapper,
addDriverRunpath,
electron,
withTetrioPlus ? false,
tetrio-plus,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "tetrio-desktop";
version = "9";
src = fetchzip {
url = "https://tetr.io/about/desktop/builds/${finalAttrs.version}/TETR.IO%20Setup.deb";
hash = "sha256-TgegFy+sHjv0ILaiLO1ghyUhKXoj8v43ACJOJhKyI0c=";
nativeBuildInputs = [ dpkg ];
};
nativeBuildInputs = [
makeWrapper
];
installPhase =
let
asarPath = if withTetrioPlus then tetrio-plus else "opt/TETR.IO/resources/app.asar";
in
''
runHook preInstall
mkdir -p $out
cp -r usr/share/ $out
mkdir -p $out/share/TETR.IO/
cp ${asarPath} $out/share/TETR.IO/app.asar
substituteInPlace $out/share/applications/TETR.IO.desktop \
--replace-fail "Exec=/opt/TETR.IO/TETR.IO" "Exec=$out/bin/tetrio"
runHook postInstall
'';
postFixup = ''
makeShellWrapper '${lib.getExe electron}' $out/bin/tetrio \
--prefix LD_LIBRARY_PATH : ${addDriverRunpath.driverLink}/lib \
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}" \
--add-flags $out/share/TETR.IO/app.asar
'';
meta = {
changelog = "https://tetr.io/about/desktop/history/";
description = "Desktop client for TETR.IO, an online stacker game";
downloadPage = "https://tetr.io/about/desktop/";
homepage = "https://tetr.io";
license = lib.licenses.unfree;
longDescription = ''
TETR.IO is a free-to-win modern yet familiar online stacker.
Play multiplayer games against friends and foes all over the world, or claim a spot on the leaderboards - the stacker future is yours!
'';
mainProgram = "tetrio";
maintainers = with lib.maintainers; [ huantian ];
platforms = [ "x86_64-linux" ];
sourceProvenance = [ lib.sourceTypes.binaryBytecode ];
};
})