From 1014ca2ad55761b54366d853da45a11194d4f531 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 14 Sep 2006 13:30:47 +0000 Subject: [PATCH] * 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 --- pkgs/development/libraries/qt-3/default.nix | 2 ++ pkgs/stdenv/generic/default.nix | 11 ++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/qt-3/default.nix b/pkgs/development/libraries/qt-3/default.nix index dd115227c29..fe707997758 100644 --- a/pkgs/development/libraries/qt-3/default.nix +++ b/pkgs/development/libraries/qt-3/default.nix @@ -57,4 +57,6 @@ stdenv.mkDerivation { # randr.h and Xrandr.h need not be in the same prefix. ./xrandr.patch ]; + + passthru = {inherit mysqlSupport;}; } diff --git a/pkgs/stdenv/generic/default.nix b/pkgs/stdenv/generic/default.nix index 548b6c8c63c..0d49a1dc6b2 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";