From 9d5859c1249fea128d39b621ae0c5520ed23a5ca Mon Sep 17 00:00:00 2001 From: Malix Date: Fri, 12 Sep 2025 20:35:18 +0200 Subject: [PATCH 01/30] nixos/pipewire: pin the linked docs --- nixos/modules/services/desktops/pipewire/pipewire.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/services/desktops/pipewire/pipewire.nix b/nixos/modules/services/desktops/pipewire/pipewire.nix index dca78ef6d301..db3c2f27e16d 100644 --- a/nixos/modules/services/desktops/pipewire/pipewire.nix +++ b/nixos/modules/services/desktops/pipewire/pipewire.nix @@ -144,7 +144,7 @@ in Enabling system-wide PipeWire is however not recommended and disabled by default according to - https://github.com/PipeWire/pipewire/blob/master/NEWS + https://github.com/PipeWire/pipewire/blob/0.3.11/NEWS#L14-L16 ''; }; From 2b115ef0cc14ebbc2ce66873873531eb7ba67b44 Mon Sep 17 00:00:00 2001 From: Jeremy Fleischman Date: Tue, 3 Feb 2026 11:58:06 -0800 Subject: [PATCH 02/30] doc: update references to `nixfmt-rfc-style` to `treefmt` This completes https://github.com/NixOS/nixpkgs/issues/425583. Rather than putting `nixfmt` everywhere, I opted to teach people to use `treefmt` instead. This is more correct, as we have formatting rules for non-nix files, and also may invoke `nixfmt` with non-default options. --- doc/languages-frameworks/python.section.md | 2 +- pkgs/applications/editors/vscode/extensions/README.md | 2 +- pkgs/by-name/ni/nixfmt-tree/package.nix | 2 +- pkgs/development/lisp-modules/import/main.lisp | 2 +- pkgs/development/lisp-modules/shell.nix | 8 +++++--- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/doc/languages-frameworks/python.section.md b/doc/languages-frameworks/python.section.md index f7a0ba9e4ba9..ce7ac04dd9b1 100644 --- a/doc/languages-frameworks/python.section.md +++ b/doc/languages-frameworks/python.section.md @@ -2136,7 +2136,7 @@ The following rules are desired to be respected: * `pythonImportsCheck` is set. This is still a good smoke test even if `pytestCheckHook` is set. * `meta.platforms` takes the default value in many cases. It does not need to be set explicitly unless the package requires a specific platform. -* The file is formatted with `nixfmt-rfc-style`. +* The file is formatted correctly (e.g., `nix-shell --run treefmt`). * Commit names of Python libraries must reflect that they are Python libraries (e.g. `python3Packages.numpy: 1.11 -> 1.12` rather than `numpy: 1.11 -> 1.12`). See also [`pkgs/README.md`](https://github.com/NixOS/nixpkgs/blob/master/pkgs/README.md#commit-conventions). diff --git a/pkgs/applications/editors/vscode/extensions/README.md b/pkgs/applications/editors/vscode/extensions/README.md index 9cbbd2b8f94d..2b36a38de2bb 100644 --- a/pkgs/applications/editors/vscode/extensions/README.md +++ b/pkgs/applications/editors/vscode/extensions/README.md @@ -7,7 +7,7 @@ * When adding a new extension, place its definition in a `default.nix` file in a directory with the extension's ID (e.g. `publisher.extension-name/default.nix`) and refer to it in `./default.nix`, e.g. `publisher.extension-name = callPackage ./publisher.extension-name { };`. -* Currently `nixfmt-rfc-style` formatter is being used to format the VSCode extensions. +* Use `nix-shell --run treefmt` to format the VSCode extensions. * Respect `alphabetical order` whenever adding extensions. If out of order, please kindly open a PR re-establishing the order. diff --git a/pkgs/by-name/ni/nixfmt-tree/package.nix b/pkgs/by-name/ni/nixfmt-tree/package.nix index d66d23ef3d2e..2d5c3a7f1422 100644 --- a/pkgs/by-name/ni/nixfmt-tree/package.nix +++ b/pkgs/by-name/ni/nixfmt-tree/package.nix @@ -95,7 +95,7 @@ treefmtWithConfig.overrideAttrs { You can achieve similar results by manually configuring `treefmt`: ```nix pkgs.treefmt.withConfig { - runtimeInputs = [ pkgs.nixfmt-rfc-style ]; + runtimeInputs = [ pkgs.nixfmt ]; settings = { # Log level for files treefmt won't format diff --git a/pkgs/development/lisp-modules/import/main.lisp b/pkgs/development/lisp-modules/import/main.lisp index 6671b8f22b4f..c131dc6efdb5 100644 --- a/pkgs/development/lisp-modules/import/main.lisp +++ b/pkgs/development/lisp-modules/import/main.lisp @@ -49,7 +49,7 @@ (truename "imported.nix"))) (defun run-nix-formatter () - (uiop:run-program '("nixfmt" "imported.nix"))) + (uiop:run-program '("treefmt" "imported.nix"))) (defun main () (format t "~%") diff --git a/pkgs/development/lisp-modules/shell.nix b/pkgs/development/lisp-modules/shell.nix index 811e8d3c1d28..02f9f2360828 100644 --- a/pkgs/development/lisp-modules/shell.nix +++ b/pkgs/development/lisp-modules/shell.nix @@ -1,10 +1,12 @@ let - pkgs = import ../../../. { }; - inherit (pkgs) mkShellNoCC sbcl nixfmt-rfc-style; + # Use CI-pinned (Hydra-cached) packages and formatter, + # rather than the local nixpkgs checkout. + inherit (import ../../../ci { }) pkgs fmt; + inherit (pkgs) mkShellNoCC sbcl; in mkShellNoCC { packages = [ - nixfmt-rfc-style + fmt.pkg (sbcl.withPackages ( ps: builtins.attrValues { From 2fe88c3f4e5472078d25831c78d6404d893354e8 Mon Sep 17 00:00:00 2001 From: Ross Smyth <18294397+RossSmyth@users.noreply.github.com> Date: Mon, 9 Feb 2026 12:26:30 -0500 Subject: [PATCH 03/30] trivial-builders: Improve derivation positioning --- .../trivial-builders/default.nix | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/pkgs/build-support/trivial-builders/default.nix b/pkgs/build-support/trivial-builders/default.nix index b350d51455cd..7a73baea2388 100644 --- a/pkgs/build-support/trivial-builders/default.nix +++ b/pkgs/build-support/trivial-builders/default.nix @@ -111,7 +111,7 @@ rec { allowSubstitutes ? false, preferLocalBuild ? true, derivationArgs ? { }, - }: + }@args: assert lib.assertMsg (destination != "" -> (lib.hasPrefix "/" destination && destination != "/")) '' destination must be an absolute path, relative to the derivation's out path, got '${destination}' instead. @@ -125,6 +125,7 @@ rec { runCommand name ( { + pos = builtins.unsafeGetAttrPos "name" args; inherit text executable @@ -333,7 +334,7 @@ rec { Type: Bool */ inheritPath ? true, - }: + }@args: writeTextFile { inherit name @@ -613,6 +614,13 @@ rec { "failOnMissing" ] // { + # Allow getting the proper position of the output derivation. + # Since one of these are required, it should be fairly accurate. + pos = + if args_ ? pname then + builtins.unsafeGetAttrPos "pname" args_ + else + builtins.unsafeGetAttrPos "name" args_; inherit preferLocalBuild allowSubstitutes; paths = mapPaths (path: "${path}${stripPrefix}") paths; passAsFile = [ "paths" ]; @@ -675,6 +683,14 @@ rec { in runCommand name { + # Get the position from the `entries` attrset if it exists. + # This is the best we can do since the other attrs are either defined here, or curried values that + # we cannot extract a position from + pos = + if lib.isAttrs entries then + builtins.unsafeGetAttrPos (builtins.head (builtins.attrNames entries)) entries + else + null; preferLocalBuild = true; allowSubstitutes = false; passthru.entries = entries'; @@ -744,12 +760,15 @@ rec { meta ? { }, passthru ? { }, substitutions ? { }, - }: + }@args: script: runCommand name ( substitutions // { + # Make the position of the derivation accurate. + # Since not having `name` is deprecated, this should be fairly accurate. + pos = lib.unsafeGetAttrPos "name" args; # TODO(@Artturin:) substitutions should be inside the env attrset # but users are likely passing non-substitution arguments through substitutions # turn off __structuredAttrs to unbreak substituteAll From c54e477305b0f4d0973f5e2953224d476e369c32 Mon Sep 17 00:00:00 2001 From: Ross Smyth <18294397+RossSmyth@users.noreply.github.com> Date: Mon, 9 Feb 2026 15:15:30 -0500 Subject: [PATCH 04/30] applyPatches: migrate to extendMkDerivation naive translation --- .../trivial-builders/default.nix | 114 +++++++++--------- 1 file changed, 57 insertions(+), 57 deletions(-) diff --git a/pkgs/build-support/trivial-builders/default.nix b/pkgs/build-support/trivial-builders/default.nix index b350d51455cd..bf93fa840a39 100644 --- a/pkgs/build-support/trivial-builders/default.nix +++ b/pkgs/build-support/trivial-builders/default.nix @@ -1000,33 +1000,34 @@ rec { ]; } */ - applyPatches = - { - src, - name ? - ( - if builtins.typeOf src == "path" then - baseNameOf src - else if builtins.isAttrs src && builtins.hasAttr "name" src then - src.name - else - throw "applyPatches: please supply a `name` argument because a default name can only be computed when the `src` is a path or is an attribute set with a `name` attribute." - ) - + "-patched", - patches ? [ ], - prePatch ? "", - postPatch ? "", - ... - }@args: - assert lib.assertMsg ( - !args ? meta - ) "applyPatches will not merge 'meta', change it in 'src' instead"; - assert lib.assertMsg ( - !args ? passthru - ) "applyPatches will not merge 'passthru', change it in 'src' instead"; - if patches == [ ] && prePatch == "" && postPatch == "" then - src # nothing to do, so use original src to avoid additional drv - else + applyPatches = lib.extendMkDerivation { + constructDrv = stdenvNoCC.mkDerivation; + + extendDrvArgs = + finalAttrs: + { + src, + name ? + ( + if builtins.typeOf src == "path" then + baseNameOf src + else if builtins.isAttrs src && builtins.hasAttr "name" src then + src.name + else + throw "applyPatches: please supply a `name` argument because a default name can only be computed when the `src` is a path or is an attribute set with a `name` attribute." + ) + + "-patched", + patches ? [ ], + prePatch ? "", + postPatch ? "", + ... + }@args: + assert lib.assertMsg ( + !args ? meta + ) "applyPatches will not merge 'meta', change it in 'src' instead"; + assert lib.assertMsg ( + !args ? passthru + ) "applyPatches will not merge 'passthru', change it in 'src' instead"; let keepAttrs = names: lib.filterAttrs (name: val: lib.elem name names); # enables tools like nix-update to determine what src attributes to replace @@ -1040,36 +1041,35 @@ rec { ] src ); in - stdenvNoCC.mkDerivation ( - { - inherit - name - src - patches - prePatch - postPatch - ; - preferLocalBuild = true; - allowSubstitutes = false; - phases = "unpackPhase patchPhase installPhase"; - installPhase = "cp -R ./ $out"; - } - # Carry (and merge) information from the underlying `src` if present. - // (optionalAttrs (src ? meta) { - inherit (src) meta; - }) - // (optionalAttrs (extraPassthru != { } || src ? passthru) { - passthru = extraPassthru // src.passthru or { }; - }) - # Forward any additional arguments to the derivation - // (removeAttrs args [ - "src" - "name" - "patches" - "prePatch" - "postPatch" - ]) - ); + { + inherit + name + src + patches + prePatch + postPatch + ; + preferLocalBuild = true; + allowSubstitutes = false; + phases = "unpackPhase patchPhase installPhase"; + installPhase = "cp -R ./ $out"; + } + # Carry (and merge) information from the underlying `src` if present. + // (optionalAttrs (src ? meta) { + inherit (src) meta; + }) + // (optionalAttrs (extraPassthru != { } || src ? passthru) { + passthru = extraPassthru // src.passthru or { }; + }) + # Forward any additional arguments to the derivation + // (removeAttrs args [ + "src" + "name" + "patches" + "prePatch" + "postPatch" + ]); + }; # TODO: move docs to Nixpkgs manual # An immutable file in the store with a length of 0 bytes. From 3b4c6073c14a9e4a4b9ec003de7e9c2ee2707fed Mon Sep 17 00:00:00 2001 From: Ross Smyth <18294397+RossSmyth@users.noreply.github.com> Date: Mon, 9 Feb 2026 15:17:32 -0500 Subject: [PATCH 05/30] applyPatches: use extendMkDerivation machinery for arg inheritance --- pkgs/build-support/trivial-builders/default.nix | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/pkgs/build-support/trivial-builders/default.nix b/pkgs/build-support/trivial-builders/default.nix index bf93fa840a39..7ebde268f9f0 100644 --- a/pkgs/build-support/trivial-builders/default.nix +++ b/pkgs/build-support/trivial-builders/default.nix @@ -1017,9 +1017,6 @@ rec { throw "applyPatches: please supply a `name` argument because a default name can only be computed when the `src` is a path or is an attribute set with a `name` attribute." ) + "-patched", - patches ? [ ], - prePatch ? "", - postPatch ? "", ... }@args: assert lib.assertMsg ( @@ -1044,10 +1041,6 @@ rec { { inherit name - src - patches - prePatch - postPatch ; preferLocalBuild = true; allowSubstitutes = false; @@ -1060,15 +1053,7 @@ rec { }) // (optionalAttrs (extraPassthru != { } || src ? passthru) { passthru = extraPassthru // src.passthru or { }; - }) - # Forward any additional arguments to the derivation - // (removeAttrs args [ - "src" - "name" - "patches" - "prePatch" - "postPatch" - ]); + }); }; # TODO: move docs to Nixpkgs manual From 4b67bd98f4cd63c91cb54dd40143e9fdac4a892b Mon Sep 17 00:00:00 2001 From: Ross Smyth <18294397+RossSmyth@users.noreply.github.com> Date: Mon, 9 Feb 2026 15:21:13 -0500 Subject: [PATCH 06/30] applyPatches: remove explicit phases --- pkgs/build-support/trivial-builders/default.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/build-support/trivial-builders/default.nix b/pkgs/build-support/trivial-builders/default.nix index 7ebde268f9f0..ed447c9be101 100644 --- a/pkgs/build-support/trivial-builders/default.nix +++ b/pkgs/build-support/trivial-builders/default.nix @@ -1044,7 +1044,11 @@ rec { ; preferLocalBuild = true; allowSubstitutes = false; - phases = "unpackPhase patchPhase installPhase"; + + dontConfigure = true; + dontBuild = true; + doCheck = false; + installPhase = "cp -R ./ $out"; } # Carry (and merge) information from the underlying `src` if present. From 9268517647203e379f54eb98736457d5e8892045 Mon Sep 17 00:00:00 2001 From: Ross Smyth <18294397+RossSmyth@users.noreply.github.com> Date: Mon, 9 Feb 2026 15:50:24 -0500 Subject: [PATCH 07/30] applyPatches: remove inherited meta.position --- pkgs/build-support/trivial-builders/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/build-support/trivial-builders/default.nix b/pkgs/build-support/trivial-builders/default.nix index ed447c9be101..3051885345ae 100644 --- a/pkgs/build-support/trivial-builders/default.nix +++ b/pkgs/build-support/trivial-builders/default.nix @@ -1053,7 +1053,7 @@ rec { } # Carry (and merge) information from the underlying `src` if present. // (optionalAttrs (src ? meta) { - inherit (src) meta; + meta = removeAttrs src.meta [ "position" ]; }) // (optionalAttrs (extraPassthru != { } || src ? passthru) { passthru = extraPassthru // src.passthru or { }; From 315a3525ceca8f442d419114233b98cd5bd57cb1 Mon Sep 17 00:00:00 2001 From: Ross Smyth <18294397+RossSmyth@users.noreply.github.com> Date: Mon, 9 Feb 2026 15:50:24 -0500 Subject: [PATCH 08/30] applyPatches: reorganize name handling, and fix meta.position --- .../trivial-builders/default.nix | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/pkgs/build-support/trivial-builders/default.nix b/pkgs/build-support/trivial-builders/default.nix index 3051885345ae..88e4ef6dbe88 100644 --- a/pkgs/build-support/trivial-builders/default.nix +++ b/pkgs/build-support/trivial-builders/default.nix @@ -1007,16 +1007,6 @@ rec { finalAttrs: { src, - name ? - ( - if builtins.typeOf src == "path" then - baseNameOf src - else if builtins.isAttrs src && builtins.hasAttr "name" src then - src.name - else - throw "applyPatches: please supply a `name` argument because a default name can only be computed when the `src` is a path or is an attribute set with a `name` attribute." - ) - + "-patched", ... }@args: assert lib.assertMsg ( @@ -1039,9 +1029,23 @@ rec { ); in { - inherit - name - ; + name = + args.name or ( + if builtins.isPath src then + baseNameOf src + "-patched" + else if builtins.isAttrs src && (src ? name) then + let + srcName = builtins.parseDrvName src; + in + "${srcName.name}-patched${lib.optionalString (srcName.version != "") "-${srcName.version}"}" + else + throw "applyPatches: please supply a `name` argument because a default name can only be computed when the `src` is a path or is an attribute set with a `name` attribute." + ); + + # Manually setting `name` can mess up positioning. + # This should fix it. + pos = builtins.unsafeGetAttrPos "src" args; + preferLocalBuild = true; allowSubstitutes = false; From c7609637eb119bf0bd54ee6f52067ae826b967b4 Mon Sep 17 00:00:00 2001 From: Ross Smyth <18294397+RossSmyth@users.noreply.github.com> Date: Mon, 9 Feb 2026 15:50:24 -0500 Subject: [PATCH 09/30] applyPatches: unconditionally set attrsets that are always set regardless --- pkgs/build-support/trivial-builders/default.nix | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/pkgs/build-support/trivial-builders/default.nix b/pkgs/build-support/trivial-builders/default.nix index 88e4ef6dbe88..6a4daf3809ac 100644 --- a/pkgs/build-support/trivial-builders/default.nix +++ b/pkgs/build-support/trivial-builders/default.nix @@ -1054,14 +1054,12 @@ rec { doCheck = false; installPhase = "cp -R ./ $out"; - } - # Carry (and merge) information from the underlying `src` if present. - // (optionalAttrs (src ? meta) { - meta = removeAttrs src.meta [ "position" ]; - }) - // (optionalAttrs (extraPassthru != { } || src ? passthru) { + passthru = extraPassthru // src.passthru or { }; - }); + + # Carry (and merge) information from the underlying `src` if present. + meta = lib.optionalAttrs (src ? meta) removeAttrs src.meta [ "position" ]; + }; }; # TODO: move docs to Nixpkgs manual From 652080d15f0945d249f2c6ab9fbb945995fffa12 Mon Sep 17 00:00:00 2001 From: Ross Smyth <18294397+RossSmyth@users.noreply.github.com> Date: Mon, 9 Feb 2026 16:09:53 -0500 Subject: [PATCH 10/30] applyPatches: ensure overrides are carried down --- .../trivial-builders/default.nix | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/pkgs/build-support/trivial-builders/default.nix b/pkgs/build-support/trivial-builders/default.nix index 6a4daf3809ac..686271082928 100644 --- a/pkgs/build-support/trivial-builders/default.nix +++ b/pkgs/build-support/trivial-builders/default.nix @@ -1018,24 +1018,24 @@ rec { let keepAttrs = names: lib.filterAttrs (name: val: lib.elem name names); # enables tools like nix-update to determine what src attributes to replace - extraPassthru = lib.optionalAttrs (lib.isAttrs src) ( + extraPassthru = lib.optionalAttrs (lib.isAttrs finalAttrs.src) ( keepAttrs [ "rev" "tag" "url" "outputHash" "outputHashAlgo" - ] src + ] finalAttrs.src ); in { name = args.name or ( - if builtins.isPath src then - baseNameOf src + "-patched" - else if builtins.isAttrs src && (src ? name) then + if builtins.isPath finalAttrs.src then + baseNameOf finalAttrs.src + "-patched" + else if builtins.isAttrs finalAttrs.src && (finalAttrs.src ? name) then let - srcName = builtins.parseDrvName src; + srcName = builtins.parseDrvName finalAttrs.src.name; in "${srcName.name}-patched${lib.optionalString (srcName.version != "") "-${srcName.version}"}" else @@ -1055,10 +1055,13 @@ rec { installPhase = "cp -R ./ $out"; - passthru = extraPassthru // src.passthru or { }; + # passthru the git and hash info for nix-update, as well + # as all the src's passthru attrs. + passthru = extraPassthru // finalAttrs.src.passthru or { }; # Carry (and merge) information from the underlying `src` if present. - meta = lib.optionalAttrs (src ? meta) removeAttrs src.meta [ "position" ]; + # If there is not src.meta, this meta block will be blank regardless. + meta = lib.optionalAttrs (finalAttrs.src ? meta) removeAttrs finalAttrs.src.meta [ "position" ]; }; }; From fe1a3f1631d7e1ee06deabe06710421ea3bf2bec Mon Sep 17 00:00:00 2001 From: Aliaksandr Date: Tue, 10 Feb 2026 02:58:40 +0200 Subject: [PATCH 11/30] gopro-tool: move overrides to package.nix --- pkgs/by-name/go/gopro-tool/package.nix | 6 +++++- pkgs/top-level/all-packages.nix | 6 ------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/pkgs/by-name/go/gopro-tool/package.nix b/pkgs/by-name/go/gopro-tool/package.nix index a5b848d28b5d..460b498dd2bc 100644 --- a/pkgs/by-name/go/gopro-tool/package.nix +++ b/pkgs/by-name/go/gopro-tool/package.nix @@ -5,7 +5,11 @@ makeWrapper, ffmpeg, vlc, + vlc' ? vlc.overrideAttrs (old: { + buildInputs = old.buildInputs ++ [ x264 ]; + }), jq, + x264, }: stdenv.mkDerivation { @@ -30,7 +34,7 @@ stdenv.mkDerivation { --prefix PATH : ${ lib.makeBinPath [ ffmpeg - vlc + vlc' jq ] } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index fa357ead5f9b..ebd26f56c63e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4528,12 +4528,6 @@ with pkgs; dotnetPackages = recurseIntoAttrs (callPackage ./dotnet-packages.nix { }); - gopro-tool = callPackage ../by-name/go/gopro-tool/package.nix { - vlc = vlc.overrideAttrs (old: { - buildInputs = old.buildInputs ++ [ x264 ]; - }); - }; - gwe = callPackage ../tools/misc/gwe { nvidia_x11 = linuxPackages.nvidia_x11; }; From eb955cdba5981d6d121c4ed47f7a56080ab8c324 Mon Sep 17 00:00:00 2001 From: Aliaksandr Date: Tue, 10 Feb 2026 02:58:57 +0200 Subject: [PATCH 12/30] gopro-tool: enable strictDeps and structuredAttrs --- pkgs/by-name/go/gopro-tool/package.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/by-name/go/gopro-tool/package.nix b/pkgs/by-name/go/gopro-tool/package.nix index 460b498dd2bc..e7b53ca984c9 100644 --- a/pkgs/by-name/go/gopro-tool/package.nix +++ b/pkgs/by-name/go/gopro-tool/package.nix @@ -25,6 +25,9 @@ stdenv.mkDerivation { nativeBuildInputs = [ makeWrapper ]; + strictDeps = true; + __structuredAttrs = true; + installPhase = '' mkdir -p $out/bin cp $src/gopro-tool $out/bin/gopro-tool From db5fa7acafcbe7835f10ffcac683fab888cedf52 Mon Sep 17 00:00:00 2001 From: Aliaksandr Date: Tue, 10 Feb 2026 02:59:14 +0200 Subject: [PATCH 13/30] gopro-tool: add passthru.tests --- pkgs/by-name/go/gopro-tool/package.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/by-name/go/gopro-tool/package.nix b/pkgs/by-name/go/gopro-tool/package.nix index e7b53ca984c9..8f9f7306300d 100644 --- a/pkgs/by-name/go/gopro-tool/package.nix +++ b/pkgs/by-name/go/gopro-tool/package.nix @@ -10,6 +10,7 @@ }), jq, x264, + nixosTests, }: stdenv.mkDerivation { @@ -43,6 +44,10 @@ stdenv.mkDerivation { } ''; + passthru.tests = { + inherit (nixosTests) gopro-tool; + }; + meta = { description = "Tool to control GoPro webcam mode in Linux (requires v4l2loopback kernel module and a firewall rule)"; license = lib.licenses.bsd3; From 662fd4baf42ff3ffe1fb8d61abcad16bb7e6d661 Mon Sep 17 00:00:00 2001 From: Aliaksandr Date: Tue, 10 Feb 2026 02:59:31 +0200 Subject: [PATCH 14/30] gopro-tool: 0-unstable-2024-04-18 -> 1.18 --- pkgs/by-name/go/gopro-tool/package.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/by-name/go/gopro-tool/package.nix b/pkgs/by-name/go/gopro-tool/package.nix index 8f9f7306300d..475d2df02067 100644 --- a/pkgs/by-name/go/gopro-tool/package.nix +++ b/pkgs/by-name/go/gopro-tool/package.nix @@ -13,15 +13,15 @@ nixosTests, }: -stdenv.mkDerivation { +stdenv.mkDerivation (finalAttrs: { pname = "gopro-tool"; - version = "0-unstable-2024-04-18"; + version = "1.18"; src = fetchFromGitHub { owner = "juchem"; repo = "gopro-tool"; - rev = "a678f0ea65e24dca9b8d848b245bd2d487d3c8ca"; - sha256 = "0sh3s38m17pci24x4kdlmlhn0gwgm28aaa6p7qs16wysk0q0h6wz"; + tag = "v${finalAttrs.version}"; + hash = "sha256-nxsIMJjacxM0PtcopZCojz9gIa20TdKJiOyeUNHQA2o="; }; nativeBuildInputs = [ makeWrapper ]; @@ -54,4 +54,4 @@ stdenv.mkDerivation { maintainers = with lib.maintainers; [ ZMon3y ]; platforms = lib.platforms.linux; }; -} +}) From e958308ebcc4722c789367703efd7786638357e8 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Tue, 10 Feb 2026 04:27:46 +0000 Subject: [PATCH 15/30] mediainfo: 25.10 -> 26.01 --- pkgs/by-name/me/mediainfo/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/me/mediainfo/package.nix b/pkgs/by-name/me/mediainfo/package.nix index dd9f50623d80..07f6a45dd05a 100644 --- a/pkgs/by-name/me/mediainfo/package.nix +++ b/pkgs/by-name/me/mediainfo/package.nix @@ -11,11 +11,11 @@ stdenv.mkDerivation (finalAttrs: { pname = "mediainfo"; - version = "25.10"; + version = "26.01"; src = fetchurl { url = "https://mediaarea.net/download/source/mediainfo/${finalAttrs.version}/mediainfo_${finalAttrs.version}.tar.xz"; - hash = "sha256-NmsyUQGrGppO55+9uOPdnni8wKIcD5sZZjE6rtPTNQI="; + hash = "sha256-FQZWytiO9O+k6Cmc/CTZt6cjVFdqaTSZIFiKzuLMPHY="; }; nativeBuildInputs = [ From eabee7d804c2c4328b5d65162f1550cde3940bf6 Mon Sep 17 00:00:00 2001 From: Ryan Omasta Date: Tue, 10 Feb 2026 16:12:51 -0700 Subject: [PATCH 16/30] limine: 10.6.6 -> 10.7.0 https://codeberg.org/Limine/Limine/releases/tag/v10.7.0 Diff: https://codeberg.org/Limine/Limine/compare/v10.6.6...v10.7.0 --- pkgs/by-name/li/limine/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/li/limine/package.nix b/pkgs/by-name/li/limine/package.nix index 547fb8c08d5f..442f393016f8 100644 --- a/pkgs/by-name/li/limine/package.nix +++ b/pkgs/by-name/li/limine/package.nix @@ -47,14 +47,14 @@ in # as bootloader for various platforms and corresponding binary and helper files. stdenv.mkDerivation (finalAttrs: { pname = "limine"; - version = "10.6.6"; + version = "10.7.0"; # We don't use the Git source but the release tarball, as the source has a # `./bootstrap` script performing network access to download resources. # Packaging that in Nix is very cumbersome. src = fetchurl { url = "https://codeberg.org/Limine/Limine/releases/download/v${finalAttrs.version}/limine-${finalAttrs.version}.tar.gz"; - hash = "sha256-xU0uygvqeWfsy5FsYQQAEwc0H15j8amW0097Fojw1DM="; + hash = "sha256-1gwgzyISeOj4QE8hZ/KDCVW8qCQYvpQE6lf/N1jt0J4="; }; enableParallelBuilding = true; From 9359589e004547b5b382550be0c6ff86e2bd9dad Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Wed, 11 Feb 2026 19:40:07 +0000 Subject: [PATCH 17/30] app2unit: 1.2.1 -> 1.3.0 --- pkgs/by-name/ap/app2unit/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/ap/app2unit/package.nix b/pkgs/by-name/ap/app2unit/package.nix index 904eb912f24d..21879d196f59 100644 --- a/pkgs/by-name/ap/app2unit/package.nix +++ b/pkgs/by-name/ap/app2unit/package.nix @@ -9,13 +9,13 @@ }: stdenvNoCC.mkDerivation (finalAttrs: { pname = "app2unit"; - version = "1.2.1"; + version = "1.3.0"; src = fetchFromGitHub { owner = "Vladimir-csp"; repo = "app2unit"; tag = "v${finalAttrs.version}"; - sha256 = "sha256-DZ0W7SygOUmjIO0+K8hS9K1U+gSp1gA6Q15eXr6rOmo="; + sha256 = "sha256-HkwcYYGNReDtPxZumnz3ZDb1sr1JcngAOqs/inO/350="; }; passthru.updateScript = nix-update-script { }; From 0088bc55d3839cc3288e195952c49e98bbf467e8 Mon Sep 17 00:00:00 2001 From: isabel Date: Wed, 11 Feb 2026 22:47:49 +0000 Subject: [PATCH 18/30] moonlight: 1.3.39 -> 2026.2.1 Diff: https://github.com/moonlight-mod/moonlight/compare/v1.3.39...v2026.2.1 Changelog: https://raw.githubusercontent.com/moonlight-mod/moonlight/refs/tags/v2026.2.1/CHANGELOG.md --- pkgs/by-name/mo/moonlight/package.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/mo/moonlight/package.nix b/pkgs/by-name/mo/moonlight/package.nix index 52d9ba4da6d2..4cfc622e53a3 100644 --- a/pkgs/by-name/mo/moonlight/package.nix +++ b/pkgs/by-name/mo/moonlight/package.nix @@ -14,13 +14,13 @@ }: stdenv.mkDerivation (finalAttrs: { pname = "moonlight"; - version = "1.3.39"; + version = "2026.2.1"; src = fetchFromGitHub { owner = "moonlight-mod"; repo = "moonlight"; tag = "v${finalAttrs.version}"; - hash = "sha256-85W5OrP9Ju4ZJRUEZLpBreKxgUrHgxxZEv7KzcpqNDo="; + hash = "sha256-BpTN9AdQEDD2XnEUsUxgkoq+EPGhtnYgJhLKF4GVZoc="; }; nativeBuildInputs = [ @@ -32,7 +32,7 @@ stdenv.mkDerivation (finalAttrs: { pnpmDeps = fetchPnpmDeps { inherit (finalAttrs) pname version src; fetcherVersion = 3; - hash = "sha256-+wGup5wJIqTzkr4mTo/CxofffQmUz3JD2s/s/oY0viM="; + hash = "sha256-b3d8VcfQjCkcJThebXJ2yvKZfU8u4QnpZgNyqP6XIu0="; }; env = { From 1161ddefa878c2eb33fc45b9bcd6c3f51bd3d8f8 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Thu, 12 Feb 2026 01:53:51 +0000 Subject: [PATCH 19/30] ndcurves: 2.1.0 -> 2.1.1 --- pkgs/by-name/nd/ndcurves/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/nd/ndcurves/package.nix b/pkgs/by-name/nd/ndcurves/package.nix index ba6732ab08e6..770fea0fa4b9 100644 --- a/pkgs/by-name/nd/ndcurves/package.nix +++ b/pkgs/by-name/nd/ndcurves/package.nix @@ -13,13 +13,13 @@ stdenv.mkDerivation (finalAttrs: { pname = "ndcurves"; - version = "2.1.0"; + version = "2.1.1"; src = fetchFromGitHub { owner = "loco-3d"; repo = "ndcurves"; rev = "v${finalAttrs.version}"; - hash = "sha256-VHxGm6fzoS51PtTj/qeZumz58ZHtxy28ihbzbnoHvHg="; + hash = "sha256-YnpC2yYEe9VNcHHDyv+glLrue/J/HXbK/VP7DTAE/q0="; }; outputs = [ From 09a52efe3dae9d7dd072452417710084f493bccf Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Thu, 12 Feb 2026 02:13:44 +0000 Subject: [PATCH 20/30] cargo-expand: 1.0.119 -> 1.0.120 --- pkgs/by-name/ca/cargo-expand/package.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/ca/cargo-expand/package.nix b/pkgs/by-name/ca/cargo-expand/package.nix index e4dd50fbe586..17607da8aeb2 100644 --- a/pkgs/by-name/ca/cargo-expand/package.nix +++ b/pkgs/by-name/ca/cargo-expand/package.nix @@ -8,16 +8,16 @@ rustPlatform.buildRustPackage (finalAttrs: { pname = "cargo-expand"; - version = "1.0.119"; + version = "1.0.120"; src = fetchFromGitHub { owner = "dtolnay"; repo = "cargo-expand"; tag = finalAttrs.version; - hash = "sha256-N48BUPnVnMJSiM3EzpSiDNLGZNWFW05toHRhokNO5gI="; + hash = "sha256-KXnAKv8202Trkkr9D9HRmxTOZ67M2Jt4dhZ9o7D86uI="; }; - cargoHash = "sha256-a8swmPQ+JuE/tqRYbV+kekZV8TloxszYq9k8VOGRBrM="; + cargoHash = "sha256-eCDjGKLPy98SuknzzIE2GZEsxFjNZKuV30Y5nBQao3s="; nativeInstallCheckInputs = [ versionCheckHook ]; doInstallCheck = true; From e9aed135b3bbcb61a0400e0f168b21182aa88fe5 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Thu, 12 Feb 2026 05:12:30 +0000 Subject: [PATCH 21/30] wit-bindgen: 0.52.0 -> 0.53.0 --- pkgs/by-name/wi/wit-bindgen/package.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/wi/wit-bindgen/package.nix b/pkgs/by-name/wi/wit-bindgen/package.nix index 87361189e5ca..3b7bb0abbe4a 100644 --- a/pkgs/by-name/wi/wit-bindgen/package.nix +++ b/pkgs/by-name/wi/wit-bindgen/package.nix @@ -6,16 +6,16 @@ rustPlatform.buildRustPackage (finalAttrs: { pname = "wit-bindgen"; - version = "0.52.0"; + version = "0.53.0"; src = fetchFromGitHub { owner = "bytecodealliance"; repo = "wit-bindgen"; rev = "v${finalAttrs.version}"; - hash = "sha256-S3iOmkAg1H6sEcXhC/7cQcrwH5OwR5ZROn0iPkUrwEY="; + hash = "sha256-TTSc4T8QR7cmAPAFzoV/9oBfKrUzVs20qMP3rwjELr4="; }; - cargoHash = "sha256-RqDlBpwCxwwoG+u7zUz8j4t5JXonTe7mvAk8PxU7Gdc="; + cargoHash = "sha256-SybsgrOlxh27CQ73IXVYlTROTRR0MU3O7Sieh5pYeHw="; # Some tests fail because they need network access to install the `wasm32-unknown-unknown` target. # However, GitHub Actions ensures a proper build. From 040369bb89be1a6c41d6dc5968a831af00c11c50 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Thu, 12 Feb 2026 05:24:32 +0000 Subject: [PATCH 22/30] python3Packages.jupyter-docprovider: 2.2.0 -> 2.2.1 --- .../python-modules/jupyter-docprovider/default.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/development/python-modules/jupyter-docprovider/default.nix b/pkgs/development/python-modules/jupyter-docprovider/default.nix index 04e2f5a615e7..55eeef745a50 100644 --- a/pkgs/development/python-modules/jupyter-docprovider/default.nix +++ b/pkgs/development/python-modules/jupyter-docprovider/default.nix @@ -7,15 +7,15 @@ jupyter-collaboration, }: -buildPythonPackage rec { +buildPythonPackage (finalAttrs: { pname = "jupyter-docprovider"; - version = "2.2.0"; + version = "2.2.1"; pyproject = true; src = fetchPypi { pname = "jupyter_docprovider"; - inherit version; - hash = "sha256-UZwPhBJsb7qWIOUYm+9t8GfX14nRJt69czAapLiN/Qw="; + inherit (finalAttrs) version; + hash = "sha256-2Ko7XbO5tAHeBRWd+No24th0hebc31l6IOWMkh9wXdo="; }; postPatch = '' @@ -41,4 +41,4 @@ buildPythonPackage rec { license = lib.licenses.bsd3; teams = [ lib.teams.jupyter ]; }; -} +}) From 756ba3eafcad2ba40cc49c6941ab1cbfbcc0f076 Mon Sep 17 00:00:00 2001 From: Sigmanificient Date: Thu, 12 Feb 2026 10:24:28 +0100 Subject: [PATCH 23/30] cfn-nag: remove version from bundlerEnv --- pkgs/by-name/cf/cfn-nag/package.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/pkgs/by-name/cf/cfn-nag/package.nix b/pkgs/by-name/cf/cfn-nag/package.nix index 71c198c9a9b7..b5f7cd01298a 100644 --- a/pkgs/by-name/cf/cfn-nag/package.nix +++ b/pkgs/by-name/cf/cfn-nag/package.nix @@ -7,7 +7,6 @@ bundlerEnv { pname = "cfn-nag"; - version = "0.8.10"; inherit ruby; gemdir = ./.; From 22f0092301e865754cbc3251246b80dbf3f460e0 Mon Sep 17 00:00:00 2001 From: Sigmanificient Date: Thu, 12 Feb 2026 10:24:40 +0100 Subject: [PATCH 24/30] compass: remove version from bundlerEnv --- pkgs/development/tools/compass/default.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/pkgs/development/tools/compass/default.nix b/pkgs/development/tools/compass/default.nix index cbf28b43f425..e09f5e9f3926 100644 --- a/pkgs/development/tools/compass/default.nix +++ b/pkgs/development/tools/compass/default.nix @@ -7,7 +7,6 @@ bundlerEnv { pname = "compass"; - version = "1.0.3"; inherit ruby; gemdir = ./.; From 849f9faa4f6a44416fc6c4c042bd73bedb8ef4a3 Mon Sep 17 00:00:00 2001 From: Sigmanificient Date: Thu, 12 Feb 2026 10:25:18 +0100 Subject: [PATCH 25/30] license_finder: remove version from bundlerEnv --- pkgs/development/tools/license_finder/default.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/pkgs/development/tools/license_finder/default.nix b/pkgs/development/tools/license_finder/default.nix index 6eb7fe397a9c..2b3247c504df 100644 --- a/pkgs/development/tools/license_finder/default.nix +++ b/pkgs/development/tools/license_finder/default.nix @@ -7,7 +7,6 @@ bundlerEnv { pname = "license_finder"; - version = "7.0.1"; inherit ruby; gemdir = ./.; From ce31931fe48a310195cb405da95200d7c393f5a2 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Thu, 12 Feb 2026 11:16:52 +0000 Subject: [PATCH 26/30] balatro: add some whitespace Make the direvation slightly more readable. --- pkgs/by-name/ba/balatro/package.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/by-name/ba/balatro/package.nix b/pkgs/by-name/ba/balatro/package.nix index eb039b8808a7..56e3b21a7539 100644 --- a/pkgs/by-name/ba/balatro/package.nix +++ b/pkgs/by-name/ba/balatro/package.nix @@ -34,8 +34,11 @@ stdenv.mkDerivation (finalAttrs: { copyDesktopItems makeWrapper ]; + buildInputs = [ love ] ++ lib.optional withMods lovely-injector; + dontUnpack = true; + desktopItems = [ (makeDesktopItem { name = "balatro"; @@ -46,13 +49,16 @@ stdenv.mkDerivation (finalAttrs: { icon = "balatro"; }) ]; + buildPhase = '' runHook preBuild + tmpdir=$(mktemp -d) 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/* + runHook postBuild ''; @@ -61,12 +67,14 @@ stdenv.mkDerivation (finalAttrs: { # 'official' way of doing it. installPhase = '' runHook preInstall + install -Dm644 $srcIcon $out/share/icons/hicolor/scalable/apps/balatro.png cat ${lib.getExe love} $patchedExe > $out/share/Balatro chmod +x $out/share/Balatro makeWrapper $out/share/Balatro $out/bin/balatro ${lib.optionalString withMods "--prefix LD_PRELOAD : '${lovely-injector}/lib/liblovely.so'"} + runHook postInstall ''; From f7f227913daf667b08b7218d0c658175d1c30ab7 Mon Sep 17 00:00:00 2001 From: Bazinga9000 Date: Mon, 24 Nov 2025 23:36:13 -0500 Subject: [PATCH 27/30] balatro: add curl to LD_LIBRARY_PATH Resolves #464807 --- pkgs/by-name/ba/balatro/package.nix | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/pkgs/by-name/ba/balatro/package.nix b/pkgs/by-name/ba/balatro/package.nix index 56e3b21a7539..bb4cf28bca89 100644 --- a/pkgs/by-name/ba/balatro/package.nix +++ b/pkgs/by-name/ba/balatro/package.nix @@ -4,6 +4,7 @@ lib, love, lovely-injector, + curl, p7zip, copyDesktopItems, makeWrapper, @@ -35,7 +36,13 @@ stdenv.mkDerivation (finalAttrs: { makeWrapper ]; - buildInputs = [ love ] ++ lib.optional withMods lovely-injector; + buildInputs = [ + love + ] + ++ lib.optionals withMods [ + lovely-injector + curl + ]; dontUnpack = true; @@ -63,8 +70,9 @@ stdenv.mkDerivation (finalAttrs: { ''; # The `cat` bit is a hack suggested by whitelje (https://github.com/ethangreen-dev/lovely-injector/pull/66#issuecomment-2319615509) - # to make it so that lovely will pick up Balatro as the game name. The `LD_PRELOAD` bit is used to load lovely and it is the - # 'official' way of doing it. + # to make it so that lovely will pick up Balatro as the game name. + # The `LD_PRELOAD` bit is used to load lovely and it is the 'official' way of doing it. + # The `LD_LIBRARY_PATH` bit adds `curl` as that is the community standard backend for network-related mods on non-Windows systems installPhase = '' runHook preInstall @@ -73,7 +81,9 @@ stdenv.mkDerivation (finalAttrs: { cat ${lib.getExe love} $patchedExe > $out/share/Balatro chmod +x $out/share/Balatro - makeWrapper $out/share/Balatro $out/bin/balatro ${lib.optionalString withMods "--prefix LD_PRELOAD : '${lovely-injector}/lib/liblovely.so'"} + makeWrapper $out/share/Balatro $out/bin/balatro ${lib.optionalString withMods '' + --prefix LD_PRELOAD : '${lovely-injector}/lib/liblovely.so' \ + --prefix LD_LIBRARY_PATH : '${lib.makeLibraryPath [ curl ]}''} runHook postInstall ''; From dc09e2399b75887b5010b913ac28348f345661aa Mon Sep 17 00:00:00 2001 From: Haylin Moore Date: Fri, 12 Sep 2025 21:02:11 -0700 Subject: [PATCH 28/30] balatro: add requireFile message Resolves #441819 --- pkgs/by-name/ba/balatro/package.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/by-name/ba/balatro/package.nix b/pkgs/by-name/ba/balatro/package.nix index bb4cf28bca89..9cb86751ae16 100644 --- a/pkgs/by-name/ba/balatro/package.nix +++ b/pkgs/by-name/ba/balatro/package.nix @@ -20,6 +20,13 @@ stdenv.mkDerivation (finalAttrs: { src = requireFile { name = "Balatro-${finalAttrs.version}.exe"; url = "https://store.steampowered.com/app/2379780/Balatro/"; + message = '' + Balatro cannot be automatically downloaded. Please download + it from Steam, locate the Balatro.exe on disk, likely in + ~/.local/share/Steam/steamapps/common/Balatro/, then upload it + to your nix store with nix-store --add-fixed sha256 Balatro.exe. + ''; + # Use `nix --extra-experimental-features nix-command hash file --sri --type sha256` to get the correct hash hash = "sha256-DXX+FkrM8zEnNNSzesmHiN0V8Ljk+buLf5DE5Z3pP0c="; }; From 49e2946b62e6a210822c40572b779b35e732c066 Mon Sep 17 00:00:00 2001 From: Brenton Simpson Date: Sat, 31 Jan 2026 23:56:33 -0500 Subject: [PATCH 29/30] balatro: use substituteInPlace for withLinuxPatch The previous patch relied on git, which meant it only worked on one specific version of the game. Moreover, it curtailed the ability to make the patch more dynamic in the future. This accomplishes the same, but is more forgiving to updates/alternate editions. --- pkgs/by-name/ba/balatro/globals.patch | 15 --------------- pkgs/by-name/ba/balatro/package.nix | 19 ++++++++++++++++++- 2 files changed, 18 insertions(+), 16 deletions(-) delete mode 100644 pkgs/by-name/ba/balatro/globals.patch diff --git a/pkgs/by-name/ba/balatro/globals.patch b/pkgs/by-name/ba/balatro/globals.patch deleted file mode 100644 index b896a1deb61a..000000000000 --- a/pkgs/by-name/ba/balatro/globals.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- result/share/balatro/globals.lua 1970-01-01 01:00:01.000000000 +0100 -+++ result/share/balatro/globals.lua 1970-01-01 01:00:01.000000000 +0100 -@@ -56,6 +56,12 @@ function Game:set_globals() - self.F_CRASH_REPORTS = false - end - -+ if love.system.getOS() == 'Linux' then -+ self.F_SAVE_TIMER = 5 -+ self.F_DISCORD = true -+ self.F_ENGLISH_ONLY = false -+ end -+ - if love.system.getOS() == 'Nintendo Switch' then - self.F_HIDE_BETA_LANGS = true - self.F_BASIC_CREDITS = true diff --git a/pkgs/by-name/ba/balatro/package.nix b/pkgs/by-name/ba/balatro/package.nix index 9cb86751ae16..4a06a2a1a5ae 100644 --- a/pkgs/by-name/ba/balatro/package.nix +++ b/pkgs/by-name/ba/balatro/package.nix @@ -69,7 +69,24 @@ stdenv.mkDerivation (finalAttrs: { tmpdir=$(mktemp -d) 7z x ${finalAttrs.src} -o$tmpdir -y - ${if withLinuxPatch then "patch $tmpdir/globals.lua -i ${./globals.patch}" else ""} + + ${ + let + patchMarker = "if love.system.getOS() == 'Nintendo Switch' then"; + in + lib.optionalString withLinuxPatch '' + substituteInPlace "$tmpdir/globals.lua" --replace-fail \ + "${patchMarker}" \ + "if love.system.getOS() == 'Linux' then + self.F_SAVE_TIMER = 5 + self.F_DISCORD = true + self.F_ENGLISH_ONLY = false + end + + ${patchMarker}" + '' + } + patchedExe=$(mktemp -u).zip 7z a $patchedExe $tmpdir/* From 5122924f493a0c9bc3354c86e34c1c97d4350788 Mon Sep 17 00:00:00 2001 From: Brenton Simpson Date: Sat, 31 Jan 2026 19:40:37 -0500 Subject: [PATCH 30/30] balatro: add support for Google Play and Xbox PC editions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Different editions of Balatro have essentially the same Lua codebase, delegating to a native bridge `love.platform` to handle cloud functionality like profiles and achievements. These bridges are not part of the standard LÖVE SDK, and hence aren't provided by`pkgs.love`. `withBridgePatch` uses the local filesystem for loading/saving games, and short-circuits the other bridge functions. This enables the Google Play and Xbox PC editions of the game to be played with the open source LÖVE runtime. --- doc/release-notes/rl-2605.section.md | 2 + pkgs/by-name/ba/balatro/bridge_detour.lua | 229 ++++++++++++++++++++++ pkgs/by-name/ba/balatro/package.nix | 76 +++++-- 3 files changed, 288 insertions(+), 19 deletions(-) create mode 100644 pkgs/by-name/ba/balatro/bridge_detour.lua diff --git a/doc/release-notes/rl-2605.section.md b/doc/release-notes/rl-2605.section.md index b0d55f8f5022..cd78b670c342 100644 --- a/doc/release-notes/rl-2605.section.md +++ b/doc/release-notes/rl-2605.section.md @@ -148,6 +148,8 @@ +- `balatro` now supports the Google Play and Xbox PC versions of the game. Pass the `apk` or `Assets.zip` as `balatro.override { src = "…" }`. + - `uptime-kuma` has been updated to v2, which requires an automated migration that can take a few hours. **A backup is highly recommended.** If your SQLite database is corrupted, the migration might fail and require [manual intervention](https://github.com/louislam/uptime-kuma/issues/5281). See the [migration guide](https://github.com/louislam/uptime-kuma/wiki/Migration-From-v1-To-v2) for more information. diff --git a/pkgs/by-name/ba/balatro/bridge_detour.lua b/pkgs/by-name/ba/balatro/bridge_detour.lua new file mode 100644 index 000000000000..a60126b34a36 --- /dev/null +++ b/pkgs/by-name/ba/balatro/bridge_detour.lua @@ -0,0 +1,229 @@ +--[[ +The game Balatro is implemented in Lua, with the standard LÖVE SDK. However, +each store that it's sold on (Steam, Google Play, Xbox PC, etc.) has its own SDK +to provide features like cloud saving and achievement unlocking. + +To allow the same platform-agnostic Lua codebase to be deployed in all these +contexts, each one has a custom bridge - `love.platform`. This allows the game +to call `writeSaveFile` and trust that it will be handled appropriately for +whatever platform the player has available. Unfortunately, that bridge is not +supplied by LÖVE, and is therefore missing from Nix's `pkgs.love`. + +This file implements the functions that would otherwise utilize that missing +bridge. It was created by finding all of the `love.platform` callsites in the +Balatro codebase, putting them in this file, and asking Gemini to implement a +Linux version. +]] + +love.platform = love.platform or {} +package.loaded["love.platform"] = love.platform + +local FileOperationStatus = { + SUCCESS = 0, + FETCH_ERROR = 1, + CLOUD_SAVE_ERROR = 2, + CONFLICT = 3, + OFFLINE = 4, + LOAD_ERROR = 5, + NOT_FOUND = 6 +} + +function love.platform.init(onInitSuccess, onInitFailure) + love.filesystem.setIdentity("balatro") + + if onInitSuccess then + onInitSuccess(love.system.getOS(), love.platform.getLocalPlayerName()) + end + return true +end + +function love.platform.setOnPlatformStatusChangedCallback(callback) + if callback then + callback(false, "Cloud unavailable.") + end +end + +function love.platform.earlyInit() end +function love.platform.update(dt) end +function love.platform.shutdown() end + + +function love.platform.getPlatformId() + return love.system.getOS() +end + +function love.platform.getLocalPlayerName() + return os.getenv("USER") or os.getenv("LOGNAME") or "Player" +end + +function love.platform.getLocalPlayerAvatar() + return nil +end + +function love.platform.isPremium() + return true +end + +function love.platform.isArcade() + return false +end + +function love.platform.isFirstTimePlaying() + return not love.platform.saveGameExists("1", "profile.jkr") +end + +function love.platform.isOffline() + -- If the game ever uses this for more than showing the offline warning, we + -- should set this back to true + return false +end + +function love.platform.getNotchPosition() + return nil +end + + +-- Different builds use different file APIs; therefore, we implement both the +-- thin wrapper around the framework's filesystem module and the more complex +-- signatures with individual save slots. +love.platform.localGetInfo = love.filesystem.getInfo +love.platform.localRead = love.filesystem.read +love.platform.localWrite = love.filesystem.write +love.platform.localRemove = love.filesystem.remove +love.platform.localCreateDirectory = love.filesystem.createDirectory + + +-- some versions store their settings files in `common/` +function love.filesystem.getInfo(filename, ...) + local info = love.platform.localGetInfo(filename, ...) + + if not info then + info = love.platform.localGetInfo("common/" .. filename, ...) + end + + return info +end + +function love.filesystem.read(filename, ...) + local content, size = love.platform.localRead(filename, ...) + + if not content then + content, size = love.platform.localRead("common/" .. filename, ...) + end + + return content, size +end + + +function love.platform.writeSaveGame(profile, filename, data) + local parent = tostring(profile) + + if not love.platform.localGetInfo(parent) then + love.platform.localCreateDirectory(parent) + end + + return love.platform.localWrite(parent .. "/" .. filename, data) +end + +function love.platform.loadSaveGame(profile, filename) + local parent = tostring(profile) + return love.platform.localRead(parent .. "/" .. filename) +end + +function love.platform.saveGameExists(profile, filename) + local parent = tostring(profile) + return love.platform.localGetInfo(parent .. "/" .. filename) ~= nil +end + +function love.platform.deleteSaveGameFile(profile, filename) + local parent = tostring(profile) + return love.platform.localRemove(parent .. "/" .. filename) +end + +function love.platform.deleteSaveGame(profile) + local parent = tostring(profile) + return love.platform.localRemove(parent) +end + +local load_game_callback +local save_game_callback + +function love.platform.setLoadGameCallback(callback) + load_game_callback = callback +end + +function love.platform.loadGameFile(filename) + local content, size = love.filesystem.read(filename) + + if load_game_callback then + if content then + load_game_callback(filename, FileOperationStatus.SUCCESS, "", content, nil, nil) + else + load_game_callback(filename, FileOperationStatus.NOT_FOUND, "File not found", nil, nil, nil) + end + end +end + + +function love.platform.setOnSaveInitializedCallback(callback) + if callback then + callback() + end +end + +function love.platform.setSaveGameCallback(callback) + save_game_callback = callback +end + +function love.platform.saveGameFile(filename, data) + local success, msg = love.filesystem.write(filename, data) + if save_game_callback then + if success then + save_game_callback(filename, FileOperationStatus.SUCCESS, "", data, nil, nil) + else + save_game_callback(filename, FileOperationStatus.CLOUD_SAVE_ERROR, msg, nil, nil, nil) + end + end +end + + +-- no-ops when there's no cloud saving +function love.platform.runLoadGameCallbacks() end +function love.platform.runSaveGameCallbacks() end +function love.platform.resolveConflict(file, content, conflictId) end + + +function love.platform.unlockAchievement(achievementId) + love.filesystem.append( + "unlock_awards.lua", + string.format("love.platform.unlockAchievement(%q)\n", achievementId) + ) +end + +function love.platform.unlockAward(awardName) + love.filesystem.append( + "unlock_awards.lua", + string.format("love.platform.unlockAward(%q)\n", awardName) + ) +end + + +function love.platform.event(name, ...) end +function love.platform.hideSplashScreen() end +function love.platform.anyButtonPressed() return false end + +--[[ these are checked before they're used by the game, so we don't have to +-- support them +function love.platform.requestReview() end +function love.platform.requestTrackingPermission() end +function love.platform.setProfileButtonActive(active) end +function love.platform.authenticateLocalPlayer() end +]] + +if love.graphics then + if love.graphics.isActive and not love.graphics.checkActive then + love.graphics.checkActive = love.graphics.isActive + end + + love.graphics.beginFrame = love.graphics.beginFrame or function() end +end diff --git a/pkgs/by-name/ba/balatro/package.nix b/pkgs/by-name/ba/balatro/package.nix index 4a06a2a1a5ae..ff6fb1ab4a43 100644 --- a/pkgs/by-name/ba/balatro/package.nix +++ b/pkgs/by-name/ba/balatro/package.nix @@ -10,26 +10,56 @@ makeWrapper, makeDesktopItem, requireFile, + src ? null, withMods ? true, + withBridgePatch ? true, withLinuxPatch ? true, }: stdenv.mkDerivation (finalAttrs: { pname = "balatro"; version = "1.0.1o"; - src = requireFile { - name = "Balatro-${finalAttrs.version}.exe"; - url = "https://store.steampowered.com/app/2379780/Balatro/"; - message = '' - Balatro cannot be automatically downloaded. Please download - it from Steam, locate the Balatro.exe on disk, likely in - ~/.local/share/Steam/steamapps/common/Balatro/, then upload it - to your nix store with nix-store --add-fixed sha256 Balatro.exe. - ''; + src = + if src != null then + src + else + requireFile { + name = "Balatro-${finalAttrs.version}.exe"; + url = "https://store.steampowered.com/app/2379780/Balatro/"; + message = '' + You must own Balatro in order to install it with Nix. The Steam, + Google Play, and Xbox PC versions are supported. - # Use `nix --extra-experimental-features nix-command hash file --sri --type sha256` to get the correct hash - hash = "sha256-DXX+FkrM8zEnNNSzesmHiN0V8Ljk+buLf5DE5Z3pP0c="; - }; + - If you have the Steam version, you can use Balatro.exe. Find it in + + ~/.local/share/Steam/steamapps/common/Balatro/ + + and run + + nix-store --add-fixed sha256 Balatro.exe + + - If you have the Google Play version, you'll need to pull base.apk from + your device: + + adb shell pm path com.playstack.balatro.android + adb pull ( path from above )/base.apk ~/Downloads/com.playstack.balatro.android.apk + + and add it to /nix/store: + + nix-prefetch-url file:///home/deck/Downloads/com.playstack.balatro.android.apk + + - If you have the Xbox PC version, you can do the same with Assets.zip. + + If you've used nix-prefetch-url to add it to your store, you'll need to + pass the resulting path to override: + + balatro.override { + src = /nix/store/g44bp7ymc7qlkfv5f03b55cgs1wdmkzl-com.playstack.balatro.android.apk; + } + ''; + # Use `nix --extra-experimental-features nix-command hash file --sri --type sha256` to get the correct hash + hash = "sha256-DXX+FkrM8zEnNNSzesmHiN0V8Ljk+buLf5DE5Z3pP0c="; + }; srcIcon = fetchurl { name = "balatro.png"; @@ -70,6 +100,16 @@ stdenv.mkDerivation (finalAttrs: { tmpdir=$(mktemp -d) 7z x ${finalAttrs.src} -o$tmpdir -y + ${lib.optionalString withBridgePatch '' + cp ${./bridge_detour.lua} $tmpdir/bridge_detour.lua + + for file in main.lua engine/load_manager.lua engine/save_manager.lua; do + if [ -f "$tmpdir/$file" ]; then + sed -i '1i require("bridge_detour")' "$tmpdir/$file" + fi + done + ''} + ${ let patchMarker = "if love.system.getOS() == 'Nintendo Switch' then"; @@ -87,22 +127,20 @@ stdenv.mkDerivation (finalAttrs: { '' } - patchedExe=$(mktemp -u).zip - 7z a $patchedExe $tmpdir/* + loveFile=game.love + 7z a -tzip $loveFile $tmpdir/* runHook postBuild ''; - # The `cat` bit is a hack suggested by whitelje (https://github.com/ethangreen-dev/lovely-injector/pull/66#issuecomment-2319615509) - # to make it so that lovely will pick up Balatro as the game name. - # The `LD_PRELOAD` bit is used to load lovely and it is the 'official' way of doing it. - # The `LD_LIBRARY_PATH` bit adds `curl` as that is the community standard backend for network-related mods on non-Windows systems installPhase = '' runHook preInstall install -Dm644 $srcIcon $out/share/icons/hicolor/scalable/apps/balatro.png - cat ${lib.getExe love} $patchedExe > $out/share/Balatro + # Packaging the love file into the executable ensures lovely finds the game's name + # https://github.com/ethangreen-dev/lovely-injector/pull/66#issuecomment-2319615509 + cat ${lib.getExe love} $loveFile > $out/share/Balatro chmod +x $out/share/Balatro makeWrapper $out/share/Balatro $out/bin/balatro ${lib.optionalString withMods ''