diff options
| author | Vladimír Čunát <v@cunat.cz> | 2020-03-04 11:58:03 +0100 |
|---|---|---|
| committer | Vladimír Čunát <v@cunat.cz> | 2020-03-12 09:40:15 +0100 |
| commit | b63f684b3d0b2e3d904ccc6348718adc7c6f93d4 (patch) | |
| tree | 103846703325184f674ede902ae69e7c7635901b /lib/customisation.nix | |
| parent | gnome-tour: fix at typo breaking metrics job (diff) | |
| download | nixpkgs-b63f684b3d0b2e3d904ccc6348718adc7c6f93d4.tar.gz | |
lib.callPackages(With): guard against a repeated mistake
For example see the parent commit.
Diffstat (limited to 'lib/customisation.nix')
| -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 ac234e3b8c6f..dc5dd7691976 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 |
