nixos-servers/machines/default.nix

73 lines
1.5 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.
'';
};
2024-11-02 22:55:25 +00:00
facterReportPath = lib.mkOption {
default = null;
type = with lib.types; nullOr path;
description = ''
Path to the nixos-facter report JSON for this machine.
'';
};
2024-09-07 10:39:30 +00:00
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
2024-11-02 22:55:25 +00:00
./warwick
./atlas
./jefke
./lewis
2024-10-28 13:12:06 +00:00
# ./talos.nix
];
})
.config
.machines;
2024-09-07 10:39:30 +00:00
})