1{ inputs, config, ... }:
2let
3 inherit (inputs.nixpkgs) lib;
4 hostOptions = lib.types.submodule (
5 { name, config, ... }:
6 {
7 options.modules = lib.mkOption {
8 default = [
9 { networking.hostName = name; }
10 inputs.self.modules.nixos.core
11 inputs.self.modules.nixos.${name}
12 { local.home.imports = [ inputs.self.modules.homeManager.${name} or { } ]; }
13 ];
14 };
15 options.nixos = lib.mkOption { default = lib.nixosSystem { inherit (config) modules; }; };
16 }
17 );
18in
19{
20 options.local.hosts = lib.mkOption { type = lib.types.attrsOf hostOptions; };
21 config.flake.nixosConfigurations = builtins.mapAttrs (_: host: host.nixos) config.local.hosts;
22}