1{ lib, fleetLib, config, ... }: with lib;2let3 host = with types; {4 options = {5 modules = mkOption {6 type = listOf (mkOptionType {7 name = "submodule";8 inherit (submodule { }) check;9 merge = lib.options.mergeOneOption;10 description = "Nixos modules";11 });12 description = "List of nixos modules";13 default = [ ];14 };15 system = mkOption {16 type = str;17 description = "Type of system";18 };19 encryptionKey = mkOption {20 type = str;21 description = "Encryption key";22 };23 };24 };25in26{27 options = with types; {28 hosts = mkOption {29 type = attrsOf (submodule host);30 default = { };31 description = "Configurations of individual hosts";32 };33 globalModules = mkOption {34 type = listOf (mkOptionType {35 name = "submodule";36 inherit (submodule { }) check;37 merge = lib.options.mergeOneOption;38 description = "Nixos modules";39 });40 description = "Modules, which should be added to every system";41 default = [ ];42 };43 };44 config = {45 hosts = fleetLib.hostsToAttrs (host: {46 modules = config.globalModules;47 });48 globalModules = import ../../nixos/modules/module-list.nix;49 };50}