1{2 lib,3 fleetLib,4 config,5 ...6}:7let8 inherit (lib.options) mkOption literalExpression;9 inherit (lib.types) path;10 inherit (lib.modules) mkRemovedOptionModule;11 inherit (fleetLib.options) mkHostsOption;12 inherit (fleetLib.types) listOfOverlay;1314 _file = ./nixpkgs.lib;15in16{17 options = {18 nixpkgs = {19 buildUsing = mkOption {20 description = ''21 Default nixpkgs to use for building the systems.22 '';23 type = path;24 };25 overlays = mkOption {26 description = ''27 Package overlays to apply for all the hosts, gets propagated into28 `hosts.*.nixosModules.nixpkgs.overlays`.29 '';30 type = listOfOverlay;31 };32 };33 hosts = mkHostsOption {34 inherit _file;35 options.nixpkgs.buildUsing = mkOption {36 description = ''37 Nixpkgs to use for building the system.3839 Note that this option is defined at the host level, not the nixosModules level,40 nixosModules will be evaluated using this flake input.41 '';42 type = path;43 default = config.nixpkgs.buildUsing;44 defaultText = literalExpression "config.nixpkgs.buildUsing";45 };46 47 48 49 config.nixos = {50 inherit _file;51 nixpkgs.overlays = config.nixpkgs.overlays;52 imports = [53 (mkRemovedOptionModule [54 "nixpkgs"55 "buildUsing"56 ] "this option should be specified at the host level, not the nixosModules level")57 ];58 };59 };60 };61}