top-level: use parentheses to group checks

Group `throwIfNot` chains with parentheses to improve readability and
hint to nixfmt the intended formatting.

This makes the result visually closer to the pre-nixfmt layout:

    checked =
      throwIfNot (lib.isList overlays) "The overlays argument to nixpkgs must be a list."
      lib.foldr (x: throwIfNot (lib.isFunction x) "All overlays passed to nixpkgs must be functions.") (r: r) overlays
      throwIfNot (lib.isList crossOverlays) "The crossOverlays argument to nixpkgs must be a list."
      lib.foldr (x: throwIfNot (lib.isFunction x) "All crossOverlays passed to nixpkgs must be functions.") (r: r) crossOverlays
      ;
This commit is contained in:
Matt Sturgeon
2025-10-24 07:15:22 +01:00
parent cab0f8f3a1
commit e92214c3a4

View File

@@ -79,17 +79,16 @@ let
inherit (lib) throwIfNot;
checked =
throwIfNot (lib.isList overlays) "The overlays argument to nixpkgs must be a list." lib.foldr
(x: throwIfNot (lib.isFunction x) "All overlays passed to nixpkgs must be functions.")
(r: r)
overlays
throwIfNot
(lib.isList crossOverlays)
"The crossOverlays argument to nixpkgs must be a list."
lib.foldr
(x: throwIfNot (lib.isFunction x) "All crossOverlays passed to nixpkgs must be functions.")
(r: r)
crossOverlays;
(throwIfNot (lib.isList overlays) "The overlays argument to nixpkgs must be a list.")
(lib.foldr (
x: throwIfNot (lib.isFunction x) "All overlays passed to nixpkgs must be functions."
) lib.id overlays)
(throwIfNot (lib.isList crossOverlays) "The crossOverlays argument to nixpkgs must be a list.")
(
lib.foldr (
x: throwIfNot (lib.isFunction x) "All crossOverlays passed to nixpkgs must be functions."
) lib.id crossOverlays
);
localSystem = lib.systems.elaborate args.localSystem;