fix(overlay): avoid recursion with final.lib, use prev.lib.optionalAttrs

Replace recursive `final.lib.optionalAttrs` with `prev.lib.optionalAttrs`
using the `?` operator to check for meshtastic existence safely.
This allows the overlay to work with both stable (25.11) and unstable.
This commit is contained in:
2026-06-07 06:45:16 -04:00
parent 346b41995f
commit 8e395729ff

View File

@@ -1,8 +1,8 @@
final: prev: let final: prev: let
inherit (final.lib) optionalAttrs;
python3 = final.python3; python3 = final.python3;
pyPkgs = python3.pkgs; pyPkgs = python3.pkgs;
in { in
{
reticulumStack = python3.pkgs.buildPythonApplication rec { reticulumStack = python3.pkgs.buildPythonApplication rec {
pname = "reticulum"; pname = "reticulum";
version = "1.2.9"; version = "1.2.9";
@@ -79,10 +79,8 @@ in {
platforms = platforms.linux; platforms = platforms.linux;
}; };
}; };
} }
# meshtastic may not be in all nixpkgs versions (not in 25.11 stable) # meshtastic may not exist in all nixpkgs versions (e.g. not in 25.11)
// optionalAttrs (builtins.hasAttr "meshtastic" prev) { // prev.lib.optionalAttrs (prev ? meshtastic) {
meshtastic = prev.meshtastic.overrideAttrs (old: { inherit (prev) meshtastic;
dontCheckRuntimeDeps = true; }
});
}