1{flake-utils}: {2 fleetConfiguration = {3 4 5 6 7 data,8 nixpkgs,9 overlays ? [],10 hosts,11 modules,12 globalModules ? [],13 }: let14 hostNames = nixpkgs.lib.attrNames hosts;15 fleetLib = import ./fleetLib.nix {16 inherit nixpkgs hostNames;17 };18 in let19 root = nixpkgs.lib.evalModules {20 modules =21 (import ../modules/fleet/_modules.nix)22 ++ [23 data24 ({...}: {25 inherit globalModules hosts;26 })27 ]28 ++ modules;29 specialArgs = {30 inherit nixpkgs fleetLib;31 };32 };33 failedAssertions = map (x: x.message) (nixpkgs.lib.filter (x: !x.assertion) root.config.assertions);34 checkedRoot =35 if failedAssertions != []36 then throw "Fleet failed assertions:\n${nixpkgs.lib.concatStringsSep "\n" (map (x: "- ${x}") failedAssertions)}"37 else nixpkgs.lib.showWarnings root.config.warnings root;38 withData = {39 root,40 data,41 }: {42 configuredHosts = root.config.hosts;43 config = root.config;44 };45 defaultData = withData {46 inherit data;47 root = checkedRoot;48 };49 uncheckedData = withData {inherit data root;};50 in {51 inherit nixpkgs overlays;52 inherit (defaultData) configuredHosts configuredSystems config buildableSystems;53 unchecked = {54 inherit (uncheckedData) configuredHosts configuredSystems config buildableSystems;55 };56 };57}