mirror of
https://github.com/hercules-ci/flake-parts.git
synced 2024-12-14 11:47:31 +00:00
moduleWithSystem: Clarify local variable names
This commit is contained in:
parent
d10c772449
commit
e0baa4cdba
1 changed files with 5 additions and 5 deletions
|
@ -13,19 +13,19 @@
|
|||
"moduleWithSystem: Could not determine the `system` parameter for this module set evaluation."
|
||||
);
|
||||
|
||||
allArgs = withSystem system (args: args);
|
||||
allPerSystemArgs = withSystem system (args: args);
|
||||
|
||||
lazyArgsPerParameter = f: builtins.mapAttrs
|
||||
(k: v: allArgs.${k} or (throw "moduleWithSystem: per-system argument `${k}` does not exist."))
|
||||
lazyPerSystemArgsPerParameter = f: builtins.mapAttrs
|
||||
(k: v: allPerSystemArgs.${k} or (throw "moduleWithSystem: per-system argument `${k}` does not exist."))
|
||||
(builtins.functionArgs f);
|
||||
|
||||
# Use reflection to make the call lazy in the argument.
|
||||
# Restricts args to the ones declared.
|
||||
callLazily = f: a: f (lazyArgsPerParameter f);
|
||||
callLazily = f: a: f (lazyPerSystemArgsPerParameter f);
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
(callLazily module allArgs)
|
||||
(callLazily module allPerSystemArgs)
|
||||
];
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue