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-31 16:03:07 +03:00
|
|
|
self.modules.dream2nix.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;
|
2023-08-31 16:03:07 +03:00
|
|
|
dream2nix.modules.dream2nix = self.modules.dream2nix;
|
2023-06-29 16:56:40 +03:00
|
|
|
dream2nix.lib.evalModules = self.lib.evalModules;
|
2023-08-31 16:03:07 +03:00
|
|
|
drv-parts = inputs.dream2nix;
|
2023-03-30 13:58:07 +03:00
|
|
|
};
|
2023-03-28 11:38:24 +03:00
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
result =
|
|
|
|
if raw
|
|
|
|
then evaluated
|
|
|
|
else evaluated.config.public;
|
|
|
|
in
|
|
|
|
result;
|
|
|
|
}
|