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 overlays;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 config = root.config;43 };44 defaultData = withData {45 inherit data;46 root = checkedRoot;47 };48 uncheckedData = withData {inherit data root;};49 in {50 inherit nixpkgs overlays;51 inherit (defaultData) config;52 unchecked = {53 inherit (uncheckedData) config;54 };55 };56}