2021-04-05 13:05:02 +00:00
|
|
|
{ lib }:
|
2022-09-06 18:55:00 +00:00
|
|
|
let
|
|
|
|
nixpkgs-lib = lib;
|
|
|
|
in
|
2020-10-18 10:46:59 +00:00
|
|
|
|
2021-04-05 13:05:02 +00:00
|
|
|
{ system ? builtins.currentSystem or "x86_64-darwin"
|
2022-02-04 10:32:40 +00:00
|
|
|
, pkgs ? null
|
2022-09-06 18:55:00 +00:00
|
|
|
, lib ? nixpkgs-lib
|
2021-04-05 13:05:02 +00:00
|
|
|
, modules
|
2020-10-18 10:46:59 +00:00
|
|
|
, inputs
|
|
|
|
, baseModules ? import ./modules/module-list.nix
|
2021-04-05 13:05:02 +00:00
|
|
|
, specialArgs ? { }
|
2021-12-08 23:13:24 +00:00
|
|
|
, check ? true
|
2020-10-18 10:46:59 +00:00
|
|
|
}@args:
|
|
|
|
|
|
|
|
let
|
2021-12-20 19:29:59 +00:00
|
|
|
argsModule = {
|
2020-10-18 10:46:59 +00:00
|
|
|
_file = ./eval-config.nix;
|
|
|
|
config = {
|
2021-12-20 19:29:59 +00:00
|
|
|
_module.args = {
|
|
|
|
inherit baseModules inputs modules;
|
|
|
|
};
|
2020-10-18 10:46:59 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
pkgsModule = { config, inputs, ... }: {
|
|
|
|
_file = ./eval-config.nix;
|
|
|
|
config = {
|
2023-07-07 08:02:38 +00:00
|
|
|
_module.args.pkgs = lib.mkIf (pkgs != null) (lib.mkForce pkgs);
|
|
|
|
|
|
|
|
nixpkgs.source = lib.mkDefault inputs.nixpkgs;
|
2021-04-05 13:05:02 +00:00
|
|
|
|
|
|
|
# This permits the configuration to override the passed-in
|
|
|
|
# system.
|
|
|
|
nixpkgs.system = lib.mkDefault system;
|
2020-10-18 10:46:59 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-06-22 12:08:42 +00:00
|
|
|
eval = lib.evalModules (builtins.removeAttrs args [ "lib" "inputs" "pkgs" "system" ] // {
|
2021-12-20 19:29:59 +00:00
|
|
|
modules = modules ++ [ argsModule pkgsModule ] ++ baseModules;
|
2020-10-18 10:46:59 +00:00
|
|
|
specialArgs = { modulesPath = builtins.toString ./modules; } // specialArgs;
|
|
|
|
});
|
|
|
|
in
|
|
|
|
|
|
|
|
{
|
2023-06-22 12:08:42 +00:00
|
|
|
inherit (eval._module.args) pkgs;
|
2020-10-18 10:46:59 +00:00
|
|
|
inherit (eval) options config;
|
|
|
|
|
|
|
|
system = eval.config.system.build.toplevel;
|
|
|
|
}
|