summary refs log tree commit diff
path: root/lib/customisation.nix
diff options
context:
space:
mode:
authorShea Levy <shea@shealevy.com>2015-01-13 08:39:54 -0500
committerShea Levy <shea@shealevy.com>2015-01-13 08:39:54 -0500
commit8921a8f53b1f48354403c7c8174cbf4f6f0fb91d (patch)
tree350ea9fae1030a5aacd14be53be162af85b95bd1 /lib/customisation.nix
parent20b1fd3fa4c6f96e91c84eae8527fe0af7d290f8 (diff)
downloadnixpkgs-8921a8f53b1f48354403c7c8174cbf4f6f0fb91d.tar
nixpkgs-8921a8f53b1f48354403c7c8174cbf4f6f0fb91d.tar.gz
nixpkgs-8921a8f53b1f48354403c7c8174cbf4f6f0fb91d.tar.bz2
nixpkgs-8921a8f53b1f48354403c7c8174cbf4f6f0fb91d.tar.lz
nixpkgs-8921a8f53b1f48354403c7c8174cbf4f6f0fb91d.tar.xz
nixpkgs-8921a8f53b1f48354403c7c8174cbf4f6f0fb91d.tar.zst
nixpkgs-8921a8f53b1f48354403c7c8174cbf4f6f0fb91d.zip
Revert "Revert "mkOverridable: Use functors to allow overridable functions""
Original commit was reverted due to using features from a newer nix than
hydra had, hydra has since been updated

This reverts commit 07e726c85c8f36d3a27fb7254f09ac69c7b94c65.
Diffstat (limited to 'lib/customisation.nix')
-rw-r--r--lib/customisation.nix7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/customisation.nix b/lib/customisation.nix
index 04a5cb42033..f16043cf9a3 100644
--- a/lib/customisation.nix
+++ b/lib/customisation.nix
@@ -65,6 +65,13 @@ rec {
           overrideDerivation = fdrv:
             makeOverridable (args: overrideDerivation (f args) fdrv) origArgs;
         })
+      else if builtins.isFunction ff then
+        { override = newArgs:
+            makeOverridable f (origArgs // (if builtins.isFunction newArgs then newArgs origArgs else newArgs));
+          __functor = self: ff;
+          deepOverride = throw "deepOverride not yet supported for functors";
+          overrideDerivation = throw "overrideDerivation not yet supported for functors";
+        }
       else ff;
 
   deepOverrider = newArgs: name: x: if builtins.isAttrs x then (