diff options
author | Shea Levy <shea@shealevy.com> | 2015-01-09 13:24:58 -0500 |
---|---|---|
committer | Shea Levy <shea@shealevy.com> | 2015-01-09 13:26:34 -0500 |
commit | 4ee556cfe9528a321f4a3746ca83f97feacf500e (patch) | |
tree | 637aab719d0146ab53b674586a2e9e1f7692a1e4 /lib/customisation.nix | |
parent | 96ae5d58bfa3bb64449bef3703238a1cdc76eff0 (diff) |
mkOverridable: Use functors to allow overridable functions
Diffstat (limited to 'lib/customisation.nix')
-rw-r--r-- | lib/customisation.nix | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/customisation.nix b/lib/customisation.nix index 04a5cb4203358..f16043cf9a3e3 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 ( |