summary refs log tree commit diff
path: root/pkgs/stdenv/generic/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/stdenv/generic/default.nix')
-rw-r--r--pkgs/stdenv/generic/default.nix26
1 files changed, 19 insertions, 7 deletions
diff --git a/pkgs/stdenv/generic/default.nix b/pkgs/stdenv/generic/default.nix
index 5bb63f1b815dd..90770e9dddc06 100644
--- a/pkgs/stdenv/generic/default.nix
+++ b/pkgs/stdenv/generic/default.nix
@@ -26,13 +26,25 @@ let {
     # stdenv and its shell.
     // {
     
-      mkDerivation = attrs: derivation (attrs // {
-        builder = if attrs ? realBuilder then attrs.realBuilder else shell;
-        args = if attrs ? args then attrs.args else
-          ["-e" (if attrs ? builder then attrs.builder else ./default-builder.sh)];
-        stdenv = body;
-        system = body.system;
-      });
+      mkDerivation = attrs:
+        (derivation (
+          (removeAttrs attrs ["meta"])
+          //
+          {
+            builder = if attrs ? realBuilder then attrs.realBuilder else shell;
+            args = if attrs ? args then attrs.args else
+              ["-e" (if attrs ? builder then attrs.builder else ./default-builder.sh)];
+            stdenv = body;
+            system = body.system;
+          })
+        )
+        //
+        # The meta attribute is passed in the resulting attribute set,
+        # but it's not part of the actual derivation, i.e., it's not
+        # passed to the builder and is not a dependency.  But since we
+        # include it in the result, it *is* available to nix-env for
+        # queries.
+        { meta = if attrs ? meta then attrs.meta else {}; };
 
     }