@@ -26,13 +26,25 @@ let {
2626 # stdenv and its shell.
2727 // {
2828
29− mkDerivation = attrs: derivation (attrs // {
30− builder = if attrs ? realBuilder then attrs.realBuilder else shell;
31− args = if attrs ? args then attrs.args else
32− ["-e" (if attrs ? builder then attrs.builder else ./default-builder.sh)];
33− stdenv = body;
34− system = body.system;
35− });
29+ mkDerivation = attrs:
30+ (derivation (
31+ (removeAttrs attrs ["meta"])
32+ //
33+ {
34+ builder = if attrs ? realBuilder then attrs.realBuilder else shell;
35+ args = if attrs ? args then attrs.args else
36+ ["-e" (if attrs ? builder then attrs.builder else ./default-builder.sh)];
37+ stdenv = body;
38+ system = body.system;
39+ })
40+ )
41+ //
42+ # The meta attribute is passed in the resulting attribute set,
43+ # but it's not part of the actual derivation, i.e., it's not
44+ # passed to the builder and is not a dependency. But since we
45+ # include it in the result, it *is* available to nix-env for
46+ # queries.
47+ { meta = if attrs ? meta then attrs.meta else {}; };
3648
3749 }
3850