difftreelog
feat set modulesPath specialArg
in: trunk
2 files changed
lib/flakePart.nixdiffbeforeafterboth--- a/lib/flakePart.nix
+++ b/lib/flakePart.nix
@@ -33,6 +33,8 @@
# To use user-provided nixpkgs, we first need to extract wanted nixpkgs attribute,
# to do that, evaluate all the modules with only needed option declared.
bootstrapEval = lib.evalModules {
+ class = "fleet";
+ prefix = ["fleetConfiguration"];
modules = [
module
{
@@ -50,6 +52,8 @@
};
bootstrapNixpkgs = bootstrapEval.config.nixpkgs.buildUsing;
normalEval = bootstrapNixpkgs.lib.evalModules {
+ class = "fleet";
+ prefix = ["fleetConfiguration"];
modules = (import ../modules/module-list.nix) ++ [
module
(
modules/nixos.nixdiffbeforeafterboth37 module:37 module:38 let38 let39 inherit (hostArgs.config) system;39 inherit (hostArgs.config) system;40 modulesPath = "${config.nixpkgs.buildUsing}/nixos/modules";40 in41 in41 config.nixpkgs.buildUsing.lib.evalModules {42 config.nixpkgs.buildUsing.lib.evalModules {43 class = "nixos";44 prefix = ["fleetConfiguration" "hosts" hostArgs.config._module.args.name "nixos"];42 modules = (import "${config.nixpkgs.buildUsing}/nixos/modules/module-list.nix") ++ [45 modules = (import "${modulesPath}/module-list.nix") ++ [43 (module // { key = "attr<host.nixos>"; })46 (module // { key = "attr<host.nixos>"; })44 (config.nixos // { key = "attr<fleet.nixos>"; })47 (config.nixos // { key = "attr<fleet.nixos>"; })45 ];48 ];46 specialArgs = {49 specialArgs = {47 inherit fleetLib inputs self;50 inherit fleetLib inputs self modulesPath;48 inputs' = mapAttrs (51 inputs' = mapAttrs (49 inputName: input:52 inputName: input:50 builtins.addErrorContext53 builtins.addErrorContext56 "input is not a flake, perhaps flake = false was added to te input declaration?"59 "input is not a flake, perhaps flake = false was added to te input declaration?"57 )60 )58 ) inputs;61 ) inputs;62 self' = builtins.addErrorContext "while retrieving system-dependent attributes for a flake's own outputs" (63 _fleetFlakeRootConfig.perInput system self64 );59 };65 };60 };66 };61 };67 };68 # (mkRemovedOptionModule ["nixosModules"] "replaced with hosts.*.nixos.imports.")74 # (mkRemovedOptionModule ["nixosModules"] "replaced with hosts.*.nixos.imports.")69 # ];75 # ];70 nixos = {76 nixos = {71 config._module.args = {77 _module.args = {72 nixosHosts = mapAttrs (_: value: value.nixos_unchecked.config) config.hosts;78 nixosHosts = mapAttrs (_: value: value.nixos_unchecked.config) config.hosts;73 hosts = config.hosts;79 hosts = config.hosts;74 host = hostArgs.config;80 host = hostArgs.config;