summary refs log tree commit diff
path: root/pkgs/lib/customisation.nix
diff options
context:
space:
mode:
authorMarc Weber <marco-oweber@gmx.de>2010-05-23 15:54:10 +0000
committerMarc Weber <marco-oweber@gmx.de>2010-05-23 15:54:10 +0000
commit32edcce80b18f8aa01cc208e19dcf0f93d0c4971 (patch)
tree14a72cbfd756c6de1ae80c53dad972a14ef72899 /pkgs/lib/customisation.nix
parent0212a63e075b039161331ffdf4c51739799bb822 (diff)
downloadnixpkgs-32edcce80b18f8aa01cc208e19dcf0f93d0c4971.tar
nixpkgs-32edcce80b18f8aa01cc208e19dcf0f93d0c4971.tar.gz
nixpkgs-32edcce80b18f8aa01cc208e19dcf0f93d0c4971.tar.bz2
nixpkgs-32edcce80b18f8aa01cc208e19dcf0f93d0c4971.tar.lz
nixpkgs-32edcce80b18f8aa01cc208e19dcf0f93d0c4971.tar.xz
nixpkgs-32edcce80b18f8aa01cc208e19dcf0f93d0c4971.tar.zst
nixpkgs-32edcce80b18f8aa01cc208e19dcf0f93d0c4971.zip
Build a package with debugging information so that you can run it within gdb or run valgrind on it.
Example: xmessageDebug = misc.debugVersion xorg.xmessage

svn path=/nixpkgs/trunk/; revision=21945
Diffstat (limited to 'pkgs/lib/customisation.nix')
-rw-r--r--pkgs/lib/customisation.nix10
1 files changed, 8 insertions, 2 deletions
diff --git a/pkgs/lib/customisation.nix b/pkgs/lib/customisation.nix
index e6a26958ae2..334c8036627 100644
--- a/pkgs/lib/customisation.nix
+++ b/pkgs/lib/customisation.nix
@@ -1,4 +1,7 @@
-let lib = import ./default.nix; in
+let lib = import ./default.nix;
+    inherit (builtins) getAttr attrNames isFunction;
+
+in
 
 rec {
 
@@ -31,7 +34,10 @@ rec {
   overrideDerivation = drv: f:
     let
       # Filter out special attributes.
-      attrs = removeAttrs drv ["meta" "passthru" "outPath" "drvPath" "hostDrv" "buildDrv" "type" "override" "deepOverride" "origArgs"];
+      drop = ["meta" "passthru" "outPath" "drvPath" "hostDrv" "buildDrv" "type" "override" "deepOverride" "origArgs"]
+              # also drop functions such as .merge .override etc
+             ++ lib.filter (n: isFunction (getAttr n drv)) (attrNames drv);
+      attrs = removeAttrs drv drop;
       newDrv = derivation (attrs // (f drv));
     in newDrv //
       { meta = if drv ? meta then drv.meta else {};