1
0
Fork 0
mirror of https://github.com/hercules-ci/flake-parts.git synced 2024-12-14 11:47:31 +00:00

lib: Update deferredModuleWith polyfill

<dfd98a5da2>

(cherry picked from commit 3bbcca6b6f)
This commit is contained in:
Dusk Banks 2023-04-19 01:28:09 +00:00 committed by Robert Hensing
parent 07f6395285
commit 0399486bc7
2 changed files with 6 additions and 3 deletions

View file

@ -37,8 +37,11 @@ let
attrs@{ staticModules ? [ ] }: mkOptionType { attrs@{ staticModules ? [ ] }: mkOptionType {
name = "deferredModule"; name = "deferredModule";
description = "module"; description = "module";
descriptionClass = "noun";
check = x: isAttrs x || isFunction x || path.check x; check = x: isAttrs x || isFunction x || path.check x;
merge = loc: defs: staticModules ++ map (def: lib.setDefaultModuleLocation "${def.file}, via option ${showOption loc}" def.value) defs; merge = loc: defs: {
imports = staticModules ++ map (def: lib.setDefaultModuleLocation "${def.file}, via option ${showOption loc}" def.value) defs;
};
inherit (submoduleWith { modules = staticModules; }) inherit (submoduleWith { modules = staticModules; })
getSubOptions getSubOptions
getSubModules; getSubModules;

View file

@ -119,9 +119,9 @@ in
_module.args.moduleWithSystem = throwAliasError "moduleWithSystem"; _module.args.moduleWithSystem = throwAliasError "moduleWithSystem";
}; };
}); });
apply = modules: system: apply = module: system:
(lib.evalModules { (lib.evalModules {
inherit modules; modules = [ module ];
prefix = [ "perSystem" system ]; prefix = [ "perSystem" system ];
specialArgs = { specialArgs = {
inherit system; inherit system;