nixos/colony: Configure for real hardware

This commit is contained in:
2022-06-17 00:54:28 +01:00
parent 29ffec5de7
commit 36d81cb656
15 changed files with 111 additions and 93 deletions

View File

@@ -33,13 +33,16 @@
inherit (lib.my) networkdAssignment;
in
{
imports = [ "${modulesPath}/profiles/qemu-guest.nix" ];
boot.kernelParams = [ "intel_iommu=on" ];
boot.loader.systemd-boot.configurationLimit = 20;
boot = {
kernelModules = [ "kvm-amd" ];
kernelParams = [ "amd_iommu=on" ];
initrd = {
availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" "sr_mod" ];
};
};
fileSystems = {
"/boot" = {
device = "/dev/disk/by-uuid/83CA-3BCF";
device = "/dev/disk/by-uuid/C1C9-9CBC";
fsType = "vfat";
};
"/nix" = {
@@ -63,14 +66,19 @@
environment.systemPackages = with pkgs; [
pciutils
partclone
lm_sensors
];
systemd = {
network = {
links = {
"10-base-ext" = {
matchConfig.MACAddress = "52:54:00:81:bd:a1";
linkConfig.Name = "base-ext";
"10-wan0" = {
matchConfig.MACAddress = "d0:50:99:fa:a7:99";
linkConfig.Name = "wan0";
};
"10-wan1" = {
matchConfig.MACAddress = "d0:50:99:fa:a7:9a";
linkConfig.Name = "wan1";
};
};
netdevs = {
@@ -149,7 +157,7 @@
my = {
#deploy.generate.system.mode = "boot";
secrets = {
key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKp5WDdDr/1NS3SJIDOKwcCNZDFOxqPAD7cbZWAP7EkX";
key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPIijqzAWF6OxKr4aeCa1TAc5xGn4rdIjVTt0wAPU6uY";
};
server.enable = true;

View File

@@ -10,7 +10,7 @@
inherit (lib) mkIf mkMerge optionals;
wanBDF =
if config.my.build.isDevVM then "00:02.0" else "01:00.0";
if config.my.build.isDevVM then "00:02.0" else "27:00.0";
vmLVM = vm: lv: {
"${lv}" = {
@@ -27,18 +27,40 @@
frontend = "virtio-blk";
};
};
installerDisk = {
installer = {
backend = {
driver = "file";
filename = "${systems.installer.configuration.config.my.buildAs.iso}/iso/nixos-installer-devplayer0.iso";
read-only = "on";
};
format.driver = "raw";
frontend = "ide-cd";
frontendOpts = {
bootindex = 1;
};
};
};
in
{
my = {
vms = {
instances = {
estuary = {
uuid = "59f51efb-7e6d-477b-a263-ed9620dbc87b";
uuid = "27796a09-c013-4031-9595-44791d6126b9";
smp = {
cpus = 2;
threads = 2;
};
memory = 3072;
networks.base = {
waitOnline = "no-carrier";
mac = "52:54:00:ab:f1:52";
mac = "52:54:00:15:1a:53";
};
drives = mkMerge ([ ] ++ (optionals (!config.my.build.isDevVM) [
drives = mkMerge ([
installerDisk
] ++ (optionals (!config.my.build.isDevVM) [
(vmLVM "estuary" "esp")
(vmLVM "estuary" "nix")
(vmLVM "estuary" "persist")
@@ -48,34 +70,20 @@
};
shill = {
uuid = "e34569ec-d24e-446b-aca8-a3b27abc1f9b";
uuid = "fc02d8c8-6f60-4b69-838a-e7aed6ee7617";
smp = {
cpus = 4;
cpus = 12;
threads = 2;
};
memory = 8192;
networks.vms.mac = "52:54:00:85:b3:b1";
memory = 65536;
networks.vms.mac = "52:54:00:27:3d:5c";
cleanShutdown.timeout = 120;
drives = mkMerge ([
{
installer = {
backend = {
driver = "file";
filename = "${systems.installer.configuration.config.my.buildAs.iso}/iso/nixos-installer-devplayer0.iso";
read-only = "on";
};
format.driver = "raw";
frontend = "ide-cd";
frontendOpts = {
bootindex = 1;
};
};
}
installerDisk
] ++ (optionals (!config.my.build.isDevVM) [
(vmLVM "shill" "esp")
(vmLVM "shill" "nix")
(vmLVM "shill" "persist")
{
esp.frontendOpts.bootindex = 0;
@@ -83,8 +91,12 @@
backend = {
driver = "host_device";
filename = "/dev/hdds/media";
discard = "unmap";
};
format = {
driver = "raw";
discard = "unmap";
};
format.driver = "raw";
frontend = "virtio-blk";
};
}