nixos-servers/machines/default.nix

66 lines
1.3 KiB
Nix
Raw Normal View History

2024-10-28 13:12:06 +00:00
{
nixpkgs,
flake-utils,
...
}:
flake-utils.lib.eachDefaultSystem (system: let
2024-09-07 10:39:30 +00:00
pkgs = nixpkgs.legacyPackages.${system};
lib = pkgs.lib;
2024-10-28 13:12:06 +00:00
machineOpts = {config, ...}: {
2024-09-07 10:39:30 +00:00
options = {
arch = lib.mkOption {
default = null;
type = with lib.types; nullOr str;
description = ''
CPU architecture of this machine.
'';
};
isRaspberryPi = lib.mkOption {
default = false;
type = lib.types.bool;
};
nixosModule = lib.mkOption {
2024-10-28 13:12:06 +00:00
default = {...}: {};
2024-09-07 10:39:30 +00:00
type = lib.types.anything;
description = ''
Customized configuration for this machine in the form of a NixOS module.
'';
};
kubernetesNodeLabels = lib.mkOption {
default = null;
type = with lib.types; nullOr attrs;
description = ''
Any labels to add to the Kubernetes node.
'';
};
};
};
allOpts = {
options = {
machines = lib.mkOption {
type = with lib.types; attrsOf (submodule machineOpts);
};
};
};
2024-10-28 13:12:06 +00:00
in {
machines =
(lib.modules.evalModules {
modules = [
allOpts
./warwick.nix
./atlas.nix
./jefke.nix
./lewis.nix
# ./talos.nix
# ./pikvm.nix
];
})
.config
.machines;
2024-09-07 10:39:30 +00:00
})