summary refs log tree commit diff
path: root/lib/customisation.nix
diff options
context:
space:
mode:
Diffstat (limited to 'lib/customisation.nix')
-rw-r--r--lib/customisation.nix7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/customisation.nix b/lib/customisation.nix
index ac234e3b8c6..dc5dd769197 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