git.delta.rocks / jrsonnet / refs/commits / a2ea38b80ded

difftreelog

source

modules/hosts.nix1.0 KiBsourcehistory
1{ lib, fleet, ... }: with lib;2let3  host = with types; {4    options = {5      modules = mkOption {6        type = listOf anything;7        description = "List of nixos modules";8        default = [ ];9      };10      network = mkOption {11        type = submodule {12          options = {13            fleetIp = {14              type = str;15              description = "Ip which is available to all hosts in fleet";16            };17          };18        };19        description = "Network definition of host";20      };21      system = mkOption {22        type = str;23        description = "Type of system";24      };25      encryptionKey = mkOption {26        type = str;27        description = "Encryption key";28      };29    };30  };31in32{33  options = with types; {34    hosts = mkOption {35      type = attrsOf (submodule host);36      default = { };37      description = "Configurations of individual hosts";38    };39  };40  config.hosts = fleet.hostsToAttrs (host: {41    modules = [42      ({ ... }: {43        nixpkgs.overlays = [ (import ../pkgs) ];44      })45    ];46  });47}