diff options
author | Robert Hensing <robert@roberthensing.nl> | 2022-03-21 22:54:07 +0100 |
---|---|---|
committer | Robert Hensing <robert@roberthensing.nl> | 2022-03-21 23:14:10 +0100 |
commit | 6a0b24b27675d03a7f24c124e6c145076104e869 (patch) | |
tree | 0371e840eab2c7f46d2aa074181058c9e79f7543 /lib | |
parent | eb8b70c020e6693b29634660fa173d7f14f882eb (diff) |
lib: applyIfFunction -> applyModuleArgsIfFunction
Diffstat (limited to 'lib')
-rw-r--r-- | lib/default.nix | 2 | ||||
-rw-r--r-- | lib/modules.nix | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/default.nix b/lib/default.nix index 3fead03a46360..1746efc681969 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -112,7 +112,7 @@ let commitIdFromGitRepo cleanSourceWith pathHasContext canCleanSource pathIsRegularFile pathIsGitRepo; inherit (self.modules) evalModules setDefaultModuleLocation - unifyModuleSyntax applyIfFunction mergeModules + unifyModuleSyntax applyModuleArgsIfFunction mergeModules mergeModules' mergeOptionDecls evalOptionValue mergeDefinitions pushDownProperties dischargeProperties filterOverrides sortProperties fixupOptionType mkIf mkAssert mkMerge mkOverride diff --git a/lib/modules.nix b/lib/modules.nix index 4c4d9f994dae7..46739746e6275 100644 --- a/lib/modules.nix +++ b/lib/modules.nix @@ -268,11 +268,11 @@ rec { # Like unifyModuleSyntax, but also imports paths and calls functions if necessary loadModule = args: fallbackFile: fallbackKey: m: if isFunction m || isAttrs m then - unifyModuleSyntax fallbackFile fallbackKey (applyIfFunction fallbackKey m args) + unifyModuleSyntax fallbackFile fallbackKey (applyModuleArgsIfFunction fallbackKey m args) else if isList m then let defs = [{ file = fallbackFile; value = m; }]; in throw "Module imports can't be nested lists. Perhaps you meant to remove one level of lists? Definitions: ${showDefs defs}" - else unifyModuleSyntax (toString m) (toString m) (applyIfFunction (toString m) (import m) args); + else unifyModuleSyntax (toString m) (toString m) (applyModuleArgsIfFunction (toString m) (import m) args); /* Collects all modules recursively into the form @@ -369,7 +369,7 @@ rec { config = addFreeformType (addMeta (removeAttrs m ["_file" "key" "disabledModules" "require" "imports" "freeformType"])); }; - applyIfFunction = key: f: args@{ config, options, lib, ... }: if isFunction f then + applyModuleArgsIfFunction = key: f: args@{ config, options, lib, ... }: if isFunction f then let # Module arguments are resolved in a strict manner when attribute set # deconstruction is used. As the arguments are now defined with the |