2023-03-28 11:38:24 +03:00
|
|
|
{
|
|
|
|
self,
|
|
|
|
lib,
|
|
|
|
inputs,
|
|
|
|
...
|
|
|
|
}: {
|
|
|
|
flake.options.lib = lib.mkOption {
|
|
|
|
type = lib.types.lazyAttrsOf lib.types.raw;
|
|
|
|
};
|
|
|
|
flake.config.lib.evalModules = args @ {
|
|
|
|
packageSets,
|
|
|
|
modules,
|
2023-03-30 13:58:07 +03:00
|
|
|
# If set, returns the result coming form nixpgs.lib.evalModules as is,
|
2023-03-28 11:38:24 +03:00
|
|
|
# otherwise it returns the derivation only (.config.public).
|
|
|
|
raw ? false,
|
|
|
|
...
|
|
|
|
}: let
|
|
|
|
forawardedArgs = builtins.removeAttrs args [
|
|
|
|
"packageSets"
|
|
|
|
"return"
|
|
|
|
];
|
|
|
|
|
|
|
|
evaluated =
|
|
|
|
lib.evalModules
|
|
|
|
(
|
|
|
|
forawardedArgs
|
|
|
|
// {
|
|
|
|
modules =
|
|
|
|
args.modules
|
|
|
|
++ [
|
2023-08-22 13:31:28 +03:00
|
|
|
self.modules.drv-parts.core
|
2023-03-28 11:38:24 +03:00
|
|
|
];
|
2023-03-30 13:58:07 +03:00
|
|
|
specialArgs =
|
|
|
|
args.specialArgs
|
2023-04-03 13:16:32 +03:00
|
|
|
or {}
|
2023-03-30 13:58:07 +03:00
|
|
|
// {
|
|
|
|
inherit packageSets;
|
|
|
|
dream2nix.modules.drv-parts = self.modules.drv-parts;
|
2023-06-29 16:56:40 +03:00
|
|
|
dream2nix.lib.evalModules = self.lib.evalModules;
|
2023-03-30 13:58:07 +03:00
|
|
|
drv-parts = inputs.drv-parts;
|
|
|
|
};
|
2023-03-28 11:38:24 +03:00
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
result =
|
|
|
|
if raw
|
|
|
|
then evaluated
|
|
|
|
else evaluated.config.public;
|
|
|
|
in
|
|
|
|
result;
|
|
|
|
}
|