summary refs log tree commit diff
path: root/lib/customisation.nix
diff options
context:
space:
mode:
Diffstat (limited to 'lib/customisation.nix')
-rw-r--r--lib/customisation.nix11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/customisation.nix b/lib/customisation.nix
index 09d7fbf74b0..c4eeee9a045 100644
--- a/lib/customisation.nix
+++ b/lib/customisation.nix
@@ -82,11 +82,12 @@ rec {
         ${if ff ? overrideAttrs then "overrideAttrs" else null} = fdrv:
           overrideResult (x: x.overrideAttrs fdrv);
       })
-      else if lib.isFunction ff then {
-        override = overrideArgs;
-        __functor = self: ff;
-        overrideDerivation = throw "overrideDerivation not yet supported for functors";
-      }
+      else if lib.isFunction ff then
+        # Transform ff into a functor while propagating its arguments
+        lib.setFunctionArgs ff (lib.functionArgs ff) // {
+          override = overrideArgs;
+          overrideDerivation = throw "overrideDerivation not yet supported for functors";
+        }
       else ff;