From c0c0c0f4fa03ea368f2a05bebb253410766eaaf0 Mon Sep 17 00:00:00 2001 From: Kristian Krsnik Date: Fri, 9 May 2025 17:59:37 +0200 Subject: [PATCH] balatro: 1.0.1n -> 1.0.1o Additionally made the source file overridable. --- pkgs/by-name/ba/balatro/package.nix | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/pkgs/by-name/ba/balatro/package.nix b/pkgs/by-name/ba/balatro/package.nix index 181cd305411b..526ca9ee051f 100644 --- a/pkgs/by-name/ba/balatro/package.nix +++ b/pkgs/by-name/ba/balatro/package.nix @@ -11,18 +11,17 @@ withMods ? true, withLinuxPatch ? true, }: -let - version = "1.0.1n"; - balatroExe = requireFile { - name = "Balatro-${version}.exe"; +stdenv.mkDerivation (finalAttrs: { + pname = "balatro"; + version = "1.0.1o"; + + src = requireFile { + name = "Balatro-${finalAttrs.version}.exe"; url = "https://store.steampowered.com/app/2379780/Balatro/"; # Use `nix hash file --sri --type sha256` to get the correct hash - hash = "sha256-mJ5pL+Qj3+ldOLFcQc64dM0edTeQSePIYpp5EuwxKXo="; + hash = "sha256-DXX+FkrM8zEnNNSzesmHiN0V8Ljk+buLf5DE5Z3pP0c="; }; -in -stdenv.mkDerivation { - pname = "balatro"; - inherit version; + nativeBuildInputs = [ p7zip copyDesktopItems @@ -43,7 +42,7 @@ stdenv.mkDerivation { buildPhase = '' runHook preBuild tmpdir=$(mktemp -d) - 7z x ${balatroExe} -o$tmpdir -y + 7z x ${finalAttrs.src} -o$tmpdir -y ${if withLinuxPatch then "patch $tmpdir/globals.lua -i ${./globals.patch}" else ""} patchedExe=$(mktemp -u).zip 7z a $patchedExe $tmpdir/* @@ -76,4 +75,4 @@ stdenv.mkDerivation { platforms = love.meta.platforms; mainProgram = "balatro"; }; -} +})