2022-05-28 23:05:30 +01:00
|
|
|
{
|
|
|
|
imports = [
|
|
|
|
./estuary
|
2022-05-29 03:30:40 +01:00
|
|
|
./shill
|
2022-05-28 23:05:30 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
nixos.systems.colony.configuration = { lib, pkgs, config, systems, ... }:
|
|
|
|
let
|
2022-05-29 15:22:49 +01:00
|
|
|
inherit (builtins) listToAttrs;
|
|
|
|
inherit (lib) mkIf mkMerge optionals;
|
2022-05-29 03:30:40 +01:00
|
|
|
|
2022-05-28 23:05:30 +01:00
|
|
|
wanBDF =
|
2022-06-17 00:54:28 +01:00
|
|
|
if config.my.build.isDevVM then "00:02.0" else "27:00.0";
|
2022-05-29 03:30:40 +01:00
|
|
|
|
|
|
|
vmLVM = vm: lv: {
|
2022-06-18 03:06:01 +01:00
|
|
|
name = lv;
|
|
|
|
backend = {
|
|
|
|
driver = "host_device";
|
|
|
|
filename = "/dev/ssds/vm-${vm}-${lv}";
|
|
|
|
# It appears this needs to be set on the backend _and_ the format
|
|
|
|
discard = "unmap";
|
2022-05-29 03:30:40 +01:00
|
|
|
};
|
2022-06-18 03:06:01 +01:00
|
|
|
format = {
|
|
|
|
driver = "raw";
|
|
|
|
discard = "unmap";
|
|
|
|
};
|
|
|
|
frontend = "virtio-blk";
|
2022-05-29 03:30:40 +01:00
|
|
|
};
|
2022-06-17 00:54:28 +01:00
|
|
|
|
|
|
|
installerDisk = {
|
2022-06-18 03:06:01 +01:00
|
|
|
name = "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;
|
2022-06-17 00:54:28 +01:00
|
|
|
};
|
|
|
|
};
|
2022-05-28 23:05:30 +01:00
|
|
|
in
|
|
|
|
{
|
|
|
|
my = {
|
|
|
|
vms = {
|
2022-05-29 03:30:40 +01:00
|
|
|
instances = {
|
|
|
|
estuary = {
|
2022-06-17 00:54:28 +01:00
|
|
|
uuid = "27796a09-c013-4031-9595-44791d6126b9";
|
2022-06-19 13:11:20 +01:00
|
|
|
cpu = "host,topoext";
|
2022-06-17 00:54:28 +01:00
|
|
|
smp = {
|
|
|
|
cpus = 2;
|
|
|
|
threads = 2;
|
|
|
|
};
|
|
|
|
memory = 3072;
|
2022-05-29 15:22:49 +01:00
|
|
|
networks.base = {
|
|
|
|
waitOnline = "no-carrier";
|
2022-06-17 00:54:28 +01:00
|
|
|
mac = "52:54:00:15:1a:53";
|
2022-05-29 15:22:49 +01:00
|
|
|
};
|
2022-06-18 03:06:01 +01:00
|
|
|
drives = [ ] ++ (optionals (!config.my.build.isDevVM) [
|
2022-06-06 15:53:57 +01:00
|
|
|
(vmLVM "estuary" "esp")
|
|
|
|
(vmLVM "estuary" "nix")
|
|
|
|
(vmLVM "estuary" "persist")
|
2022-06-18 03:06:01 +01:00
|
|
|
]);
|
2022-05-29 03:30:40 +01:00
|
|
|
hostDevices."${wanBDF}" = { };
|
|
|
|
};
|
2022-06-11 16:42:00 +01:00
|
|
|
|
2022-05-29 03:30:40 +01:00
|
|
|
shill = {
|
2022-06-17 00:54:28 +01:00
|
|
|
uuid = "fc02d8c8-6f60-4b69-838a-e7aed6ee7617";
|
2022-06-19 13:11:20 +01:00
|
|
|
cpu = "host,topoext";
|
2022-06-11 16:42:00 +01:00
|
|
|
smp = {
|
2022-06-17 00:54:28 +01:00
|
|
|
cpus = 12;
|
2022-06-11 16:42:00 +01:00
|
|
|
threads = 2;
|
|
|
|
};
|
2022-06-17 00:54:28 +01:00
|
|
|
memory = 65536;
|
|
|
|
networks.vms.mac = "52:54:00:27:3d:5c";
|
2022-06-11 16:42:00 +01:00
|
|
|
cleanShutdown.timeout = 120;
|
2022-06-18 03:06:01 +01:00
|
|
|
drives = [ ] ++ (optionals (!config.my.build.isDevVM) [
|
2022-05-29 15:22:49 +01:00
|
|
|
(vmLVM "shill" "esp")
|
|
|
|
(vmLVM "shill" "nix")
|
|
|
|
(vmLVM "shill" "persist")
|
2022-06-11 19:13:20 +01:00
|
|
|
{
|
2022-06-18 03:06:01 +01:00
|
|
|
name = "media";
|
|
|
|
backend = {
|
|
|
|
driver = "host_device";
|
|
|
|
filename = "/dev/hdds/media";
|
|
|
|
discard = "unmap";
|
|
|
|
};
|
|
|
|
format = {
|
|
|
|
driver = "raw";
|
|
|
|
discard = "unmap";
|
2022-06-11 19:13:20 +01:00
|
|
|
};
|
2022-06-18 03:06:01 +01:00
|
|
|
frontend = "virtio-blk";
|
2022-06-11 19:13:20 +01:00
|
|
|
}
|
2022-06-18 03:06:01 +01:00
|
|
|
]);
|
2022-05-28 23:05:30 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|