nixos-servers/nixos/machines/default.nix

169 lines
3.6 KiB
Nix
Raw Normal View History

2024-02-27 22:28:52 +00:00
# TODO: Create a nixos module system for this. (mkMerge)
# That way, we don't have to specify isRaspberryPi on every machine... etc.
{
2024-02-26 22:08:12 +00:00
warwick = {
type = "physical";
arch = "aarch64-linux";
2024-02-27 22:28:52 +00:00
isRaspberryPi = true;
isHypervisor = false;
isVirtualMachine = false;
2024-02-26 22:08:12 +00:00
nixosModule.lab = {
storage = {
osDisk = "/dev/sda";
};
};
};
atlas = {
type = "physical";
2024-02-26 22:08:12 +00:00
arch = "x86_64-linux";
2024-02-27 22:28:52 +00:00
isRaspberryPi = false;
isHypervisor = true;
isVirtualMachine = false;
nixosModule.lab = {
storage = {
osDisk = "/dev/sda";
dataPartition = "/dev/nvme0n1p1";
};
ssh = {
useCertificates = true;
hostCert = builtins.readFile ./certificates/atlas/host_ed25519.crt;
userCert = builtins.readFile ./certificates/atlas/user_ed25519.crt;
};
};
};
jefke = {
2024-01-28 10:48:13 +00:00
type = "physical";
2024-02-26 22:08:12 +00:00
arch = "x86_64-linux";
2024-02-27 22:28:52 +00:00
isRaspberryPi = false;
isHypervisor = true;
isVirtualMachine = false;
2024-02-27 22:28:52 +00:00
nixosModule.lab = {
storage = {
osDisk = "/dev/sda";
dataPartition = "/dev/nvme0n1p1";
};
2024-02-27 22:28:52 +00:00
ssh = {
useCertificates = true;
hostCert = builtins.readFile ./certificates/jefke/host_ed25519.crt;
userCert = builtins.readFile ./certificates/jefke/user_ed25519.crt;
};
};
};
lewis = {
2024-01-28 10:48:13 +00:00
type = "physical";
2024-02-26 22:08:12 +00:00
arch = "x86_64-linux";
2024-02-27 22:28:52 +00:00
isRaspberryPi = false;
isHypervisor = true;
isVirtualMachine = false;
nixosModule.lab = {
backups.enable = true;
data-sharing.enable = true;
networking.dmz.allowConnectivity = true;
storage = {
osDisk = "/dev/sda";
dataPartition = "/dev/nvme0n1p1";
};
2024-01-17 20:28:15 +00:00
ssh = {
useCertificates = true;
hostCert = builtins.readFile ./certificates/lewis/host_ed25519.crt;
userCert = builtins.readFile ./certificates/lewis/user_ed25519.crt;
};
2024-01-28 10:48:13 +00:00
};
};
2024-01-29 21:21:15 +00:00
hermes = {
type = "virtual";
hypervisorName = "lewis";
2024-02-27 22:28:52 +00:00
isRaspberryPi = false;
isVirtualMachine = true;
isHypervisor = false;
nixosModule = { config, ... }: {
2024-01-29 21:21:15 +00:00
lab = {
2024-02-27 22:28:52 +00:00
networking = {
dmz.services.enable = true;
staticNetworking = true;
staticIPv4 = config.lab.networking.dmz.ipv4.services;
staticIPv6 = config.lab.networking.dmz.ipv6.services;
};
vm = {
# TODO: would be cool to create a check that a mac address is only ever assigned to one VM.
2024-02-11 13:18:11 +00:00
# TODO: idea: what if we generated these IDs by hashing the host name and reducing that to the amount of hosts possible?
id = 7;
2024-02-07 22:15:48 +00:00
shares = [{
name = "dnsmasq";
mountPoint = "/var/lib/dnsmasq";
}];
};
2024-01-29 21:21:15 +00:00
};
};
};
maestro = {
type = "virtual";
2024-02-06 21:03:25 +00:00
hypervisorName = "atlas";
2024-02-27 22:28:52 +00:00
isRaspberryPi = false;
isVirtualMachine = false;
isHypervisor = false;
nixosModule = { config, ... }: {
microvm.balloonMem = 7680;
2024-02-07 22:15:48 +00:00
lab = {
dockerSwarm.enable = true;
2024-02-07 22:15:48 +00:00
vm = {
id = 1;
};
};
};
};
bancomart = {
type = "virtual";
2024-02-06 21:03:25 +00:00
hypervisorName = "jefke";
2024-02-27 22:28:52 +00:00
isRaspberryPi = false;
isVirtualMachine = false;
isHypervisor = false;
nixosModule = {
microvm.balloonMem = 7680;
2024-02-07 22:15:48 +00:00
lab = {
dockerSwarm.enable = true;
vm.id = 2;
2024-02-06 21:03:25 +00:00
};
};
};
vpay = {
2024-02-06 21:03:25 +00:00
type = "virtual";
hypervisorName = "lewis";
2024-02-27 22:28:52 +00:00
isRaspberryPi = false;
isVirtualMachine = false;
isHypervisor = false;
2024-02-06 21:03:25 +00:00
nixosModule = {
2024-02-25 18:06:56 +00:00
microvm.balloonMem = 5120;
2024-02-07 22:15:48 +00:00
lab = {
dockerSwarm.enable = true;
vm.id = 3;
};
};
};
}