{ lib, ... }:
let
machineOpts = { config, ... }: {
options = {
kind = lib.mkOption {
type = lib.types.enum [ "physical" "virtual" ];
description = ''
Whether this machine is physical or virtual.
'';
};
hypervisorName = lib.mkOption {
default = null;
type = with lib.types; nullOr str;
The host name of the hypervisor hosting this virtual machine.
arch = lib.mkOption {
CPU architecture of this machine.
isRaspberryPi = lib.mkOption {
default = false;
type = lib.types.bool;
isHypervisor = lib.mkOption {
# Derived value
isPhysical = lib.mkOption {
default = config.kind == "physical";
isVirtual = lib.mkOption {
default = config.kind == "virtual";
nixosModule = lib.mkOption {
default = { ... }: { };
type = lib.types.anything;
Customized configuration for this machine in the form of a NixOS module.
in
{
imports = [
./warwick.nix
./atlas.nix
./jefke.nix
./lewis.nix
./hermes.nix
./maestro.nix
./vpay.nix
];
machines = lib.mkOption {
type = with lib.types; attrsOf (submodule machineOpts);
}