1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2024-12-14 11:57:34 +00:00
nix-darwin/eval-config.nix
2023-07-24 23:24:20 +01:00

29 lines
592 B
Nix

{ lib
, modules
, baseModules ? import ./modules/module-list.nix
, specialArgs ? { }
, check ? true
}@args:
let
argsModule = {
_file = ./eval-config.nix;
config = {
_module.args = {
inherit baseModules modules;
};
};
};
eval = lib.evalModules (builtins.removeAttrs args [ "lib" ] // {
modules = modules ++ [ argsModule ] ++ baseModules;
specialArgs = { modulesPath = builtins.toString ./modules; } // specialArgs;
});
in
{
inherit (eval._module.args) pkgs;
inherit (eval) options config;
system = eval.config.system.build.toplevel;
}