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 commit3bbcca6b6f
)
This commit is contained in:
parent
07f6395285
commit
0399486bc7
2 changed files with 6 additions and 3 deletions
5
lib.nix
5
lib.nix
|
@ -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;
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue