mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-10 03:23:29 +03:00
nixpkgs: Check overlays types
This seems to be a common mistake and is worth checking so we can provide a better error message.
This commit is contained in:
parent
d4c6319803
commit
cf73196411
1 changed files with 10 additions and 1 deletions
|
@ -49,6 +49,15 @@ let # Rename the function arguments
|
||||||
in let
|
in let
|
||||||
lib = import ../../lib;
|
lib = import ../../lib;
|
||||||
|
|
||||||
|
throwIfNot = b: msg: if b then x: x else throw msg;
|
||||||
|
|
||||||
|
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
|
||||||
|
;
|
||||||
|
|
||||||
localSystem = lib.systems.elaborate args.localSystem;
|
localSystem = lib.systems.elaborate args.localSystem;
|
||||||
|
|
||||||
# Condition preserves sharing which in turn affects equality.
|
# Condition preserves sharing which in turn affects equality.
|
||||||
|
@ -121,4 +130,4 @@ in let
|
||||||
|
|
||||||
pkgs = boot stages;
|
pkgs = boot stages;
|
||||||
|
|
||||||
in pkgs
|
in checked pkgs
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue