balatro: 1.0.1n -> 1.0.1o

Additionally made the source file overridable.
This commit is contained in:
Kristian Krsnik
2025-05-09 17:59:37 +02:00
parent b3582c75c7
commit c0c0c0f4fa

View File

@@ -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";
};
}
})