summary refs log tree commit diff
path: root/pkgs/stdenv/generic
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2006-09-14 13:30:47 +0000
committerEelco Dolstra <eelco.dolstra@logicblox.com>2006-09-14 13:30:47 +0000
commit1014ca2ad55761b54366d853da45a11194d4f531 (patch)
tree50f24b302ad157afdd595134bb3629c34e01400d /pkgs/stdenv/generic
parent8e5b3024035da08c35a394ba33a66a323957d293 (diff)
downloadnixlib-1014ca2ad55761b54366d853da45a11194d4f531.tar
nixlib-1014ca2ad55761b54366d853da45a11194d4f531.tar.gz
nixlib-1014ca2ad55761b54366d853da45a11194d4f531.tar.bz2
nixlib-1014ca2ad55761b54366d853da45a11194d4f531.tar.lz
nixlib-1014ca2ad55761b54366d853da45a11194d4f531.tar.xz
nixlib-1014ca2ad55761b54366d853da45a11194d4f531.tar.zst
nixlib-1014ca2ad55761b54366d853da45a11194d4f531.zip
* stdenv.mkDerivation: add any attributes in the "passthru" attribute
  set to the result, but don't use them in the actual derivation (so
  they're not inputs).  Useful to pass through extra attributes that
  are not inputs, but should be made available to Nix expressions
  using the derivation (e.g., in assertions).

svn path=/nixpkgs/trunk/; revision=6521
Diffstat (limited to 'pkgs/stdenv/generic')
-rw-r--r--pkgs/stdenv/generic/default.nix11
1 files changed, 8 insertions, 3 deletions
diff --git a/pkgs/stdenv/generic/default.nix b/pkgs/stdenv/generic/default.nix
index 548b6c8c63cd..0d49a1dc6b22 100644
--- a/pkgs/stdenv/generic/default.nix
+++ b/pkgs/stdenv/generic/default.nix
@@ -31,7 +31,7 @@ let {
         # stdenv and its shell.
         mkDerivation = attrs:
           (derivation (
-            (removeAttrs attrs ["meta"])
+            (removeAttrs attrs ["meta" "passthru"])
             //
             {
               builder = if attrs ? realBuilder then attrs.realBuilder else shell;
@@ -41,13 +41,18 @@ let {
               system = result.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 {}; };
+          //
+          { meta = if attrs ? meta then attrs.meta else {}; }
+          # Pass through extra attributes that are not inputs, but
+          # should be made available to Nix expressions using the
+          # derivation (e.g., in assertions).
+          //
+          (if attrs ? passthru then attrs.passthru else {});
 
         # Utility value: is this a Darwin system?
         isDarwin = result.system == "i686-darwin" || result.system == "powerpc-darwin";