diff options
author | Tuomas Tynkkynen <tuomas@tuxera.com> | 2018-02-03 02:50:21 +0200 |
---|---|---|
committer | Tuomas Tynkkynen <tuomas@tuxera.com> | 2018-02-03 02:50:21 +0200 |
commit | 10c8e6d0c590d6c83aa2efee7f701983440cca78 (patch) | |
tree | b79325512b90438381604e1487ce0c1b63771f2f /lib/customisation.nix | |
parent | 2fb4606f38deefa76da5d853645739f2faa315de (diff) | |
parent | c70c9649eaca0409b7104a02193cd81ee8e5103a (diff) | |
download | nixlib-10c8e6d0c590d6c83aa2efee7f701983440cca78.tar nixlib-10c8e6d0c590d6c83aa2efee7f701983440cca78.tar.gz nixlib-10c8e6d0c590d6c83aa2efee7f701983440cca78.tar.bz2 nixlib-10c8e6d0c590d6c83aa2efee7f701983440cca78.tar.lz nixlib-10c8e6d0c590d6c83aa2efee7f701983440cca78.tar.xz nixlib-10c8e6d0c590d6c83aa2efee7f701983440cca78.tar.zst nixlib-10c8e6d0c590d6c83aa2efee7f701983440cca78.zip |
Merge remote-tracking branch 'upstream/master' into staging
Diffstat (limited to 'lib/customisation.nix')
-rw-r--r-- | lib/customisation.nix | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/customisation.nix b/lib/customisation.nix index 3988f4e9b690..823395f04d4a 100644 --- a/lib/customisation.nix +++ b/lib/customisation.nix @@ -1,7 +1,7 @@ { lib }: let - inherit (builtins) attrNames isFunction; + inherit (builtins) attrNames; in @@ -72,7 +72,7 @@ rec { makeOverridable = f: origArgs: let ff = f origArgs; - overrideWith = newArgs: origArgs // (if builtins.isFunction newArgs then newArgs origArgs else newArgs); + overrideWith = newArgs: origArgs // (if lib.isFunction newArgs then newArgs origArgs else newArgs); in if builtins.isAttrs ff then (ff // { override = newArgs: makeOverridable f (overrideWith newArgs); @@ -81,7 +81,7 @@ rec { ${if ff ? overrideAttrs then "overrideAttrs" else null} = fdrv: makeOverridable (args: (f args).overrideAttrs fdrv) origArgs; }) - else if builtins.isFunction ff then { + else if lib.isFunction ff then { override = newArgs: makeOverridable f (overrideWith newArgs); __functor = self: ff; overrideDerivation = throw "overrideDerivation not yet supported for functors"; @@ -112,8 +112,8 @@ rec { */ callPackageWith = autoArgs: fn: args: let - f = if builtins.isFunction fn then fn else import fn; - auto = builtins.intersectAttrs (builtins.functionArgs f) autoArgs; + f = if lib.isFunction fn then fn else import fn; + auto = builtins.intersectAttrs (lib.functionArgs f) autoArgs; in makeOverridable f (auto // args); @@ -122,8 +122,8 @@ rec { individual attributes. */ callPackagesWith = autoArgs: fn: args: let - f = if builtins.isFunction fn then fn else import fn; - auto = builtins.intersectAttrs (builtins.functionArgs f) autoArgs; + f = if lib.isFunction fn then fn else import fn; + auto = builtins.intersectAttrs (lib.functionArgs f) autoArgs; origArgs = auto // args; pkgs = f origArgs; mkAttrOverridable = name: pkg: makeOverridable (newArgs: (f newArgs).${name}) origArgs; |