diff options
author | Vladimír Čunát <v@cunat.cz> | 2020-03-12 09:41:12 +0100 |
---|---|---|
committer | Vladimír Čunát <v@cunat.cz> | 2020-03-12 09:41:12 +0100 |
commit | 4d543ca04833e56bc21acdec9cd0939eed71d590 (patch) | |
tree | 19bee02358f033964e4e19ef8591c9b7b27105bd /lib | |
parent | fd04c3afbbd6dee3d2ac68c074ac58c9d62b2bb8 (diff) | |
parent | b63f684b3d0b2e3d904ccc6348718adc7c6f93d4 (diff) |
Merge #81713: lib.callPackages(With): guard against a repeated mistake
Diffstat (limited to 'lib')
-rw-r--r-- | lib/customisation.nix | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/customisation.nix b/lib/customisation.nix index ac234e3b8c6fb..dc5dd76919765 100644 --- a/lib/customisation.nix +++ b/lib/customisation.nix @@ -131,7 +131,12 @@ rec { origArgs = auto // args; pkgs = f origArgs; mkAttrOverridable = name: _: makeOverridable (newArgs: (f newArgs).${name}) origArgs; - in lib.mapAttrs mkAttrOverridable pkgs; + in + if lib.isDerivation pkgs then throw + ("function `callPackages` was called on a *single* derivation " + + ''"${pkgs.name or "<unknown-name>"}";'' + + " did you mean to use `callPackage` instead?") + else lib.mapAttrs mkAttrOverridable pkgs; /* Add attributes to each output of a derivation without changing |