Unverified Commit e92214c3 authored by Matt Sturgeon's avatar Matt Sturgeon
Browse files

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
      ;
parent cab0f8f3
Loading
Loading
Loading
Loading
+10 −11
Original line number Diff line number Diff line
@@ -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;