2022-05-28 23:05:30 +01:00
|
|
|
{
|
|
|
|
imports = [
|
|
|
|
./estuary
|
2022-05-29 03:30:40 +01:00
|
|
|
./shill
|
2022-08-01 17:44:08 +01:00
|
|
|
./whale2
|
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
|
|
|
|
|
|
|
vmLVM = vm: lv: {
|
2022-06-18 03:06:01 +01:00
|
|
|
name = lv;
|
|
|
|
backend = {
|
|
|
|
driver = "host_device";
|
2023-02-19 16:47:13 +00:00
|
|
|
filename = "/dev/main/vm-${vm}-${lv}";
|
2022-06-18 03:06:01 +01:00
|
|
|
# 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";
|
2022-08-01 17:44:08 +01:00
|
|
|
#filename = "${systems.installer.configuration.config.my.buildAs.iso}/iso/nixos-installer-devplayer0.iso";
|
2023-08-26 23:26:19 +01:00
|
|
|
#filename = "/persist/home/dev/nixos-installer-devplayer0.iso";
|
2023-11-11 15:56:27 +00:00
|
|
|
#filename = "/persist/home/dev/debian-12.1.0-amd64-netinst.iso";
|
|
|
|
filename = "/persist/home/dev/ubuntu-22.04.3-live-server-amd64.iso";
|
2022-06-18 03:06:01 +01:00
|
|
|
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
|
|
|
|
{
|
2022-06-30 03:24:10 +01:00
|
|
|
systemd = {
|
|
|
|
network = {
|
|
|
|
links = {
|
2022-10-06 19:03:29 +01:00
|
|
|
#"10-wan10g" = {
|
|
|
|
# matchConfig.Path = "pci-0000:2d:00.0";
|
|
|
|
# linkConfig.Name = "wan10g";
|
|
|
|
#};
|
2022-06-30 03:24:10 +01:00
|
|
|
};
|
|
|
|
netdevs = {
|
2022-10-06 19:03:29 +01:00
|
|
|
#"25-vm-wan10g" = {
|
|
|
|
# netdevConfig = {
|
|
|
|
# Name = "vm-wan10g";
|
|
|
|
# Kind = "macvtap";
|
|
|
|
# };
|
|
|
|
# # TODO: Upstream this missing section
|
|
|
|
# extraConfig = ''
|
|
|
|
# [MACVTAP]
|
|
|
|
# Mode=passthru
|
|
|
|
# '';
|
|
|
|
#};
|
2022-06-30 03:24:10 +01:00
|
|
|
};
|
|
|
|
networks = {
|
2022-10-06 19:03:29 +01:00
|
|
|
#"75-wan10g" = {
|
|
|
|
# matchConfig.Name = "wan10g";
|
|
|
|
# networkConfig.MACVTAP = "vm-wan10g";
|
|
|
|
#};
|
|
|
|
#"75-vm-wan10g" = {
|
|
|
|
# matchConfig.Name = "vm-wan10g";
|
|
|
|
# linkConfig.RequiredForOnline = "no";
|
|
|
|
#};
|
2022-06-30 03:24:10 +01:00
|
|
|
};
|
|
|
|
};
|
2022-07-01 02:30:29 +01:00
|
|
|
|
|
|
|
services = {
|
2022-10-07 20:26:23 +01:00
|
|
|
#"vm@estuary" =
|
|
|
|
#let
|
|
|
|
# vtapUnit = "sys-subsystem-net-devices-vm\\x2dwan10g.device";
|
|
|
|
#in
|
|
|
|
#{
|
|
|
|
# requires = [ vtapUnit ];
|
|
|
|
# after = [ vtapUnit ];
|
|
|
|
#};
|
2022-07-01 02:30:29 +01:00
|
|
|
};
|
2022-06-30 03:24:10 +01:00
|
|
|
};
|
|
|
|
|
2022-05-28 23:05:30 +01:00
|
|
|
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-06-30 03:24:10 +01:00
|
|
|
networks = {
|
2022-10-06 19:03:29 +01:00
|
|
|
# Mellanox ConnectX-2 hackery
|
|
|
|
#wan = {
|
|
|
|
# ifname = "vm-wan10g";
|
|
|
|
# bridge = null;
|
|
|
|
# tapFD = 100;
|
|
|
|
# # Real hardware MAC
|
|
|
|
# mac = "00:02:c9:56:24:6e";
|
|
|
|
# waitOnline = false;
|
|
|
|
#};
|
2022-06-30 03:24:10 +01:00
|
|
|
base = {
|
|
|
|
waitOnline = "carrier";
|
|
|
|
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-30 03:24:10 +01:00
|
|
|
(mkMerge [ (vmLVM "estuary" "esp") { frontendOpts.bootindex = 0; } ])
|
2022-06-06 15:53:57 +01:00
|
|
|
(vmLVM "estuary" "nix")
|
|
|
|
(vmLVM "estuary" "persist")
|
2022-06-18 03:06:01 +01:00
|
|
|
]);
|
2022-06-30 00:50:50 +01:00
|
|
|
hostDevices = {
|
|
|
|
net-wan0 = {
|
|
|
|
index = 0;
|
|
|
|
hostBDF = if config.my.build.isDevVM then "00:02.0" else "27:00.0";
|
|
|
|
};
|
|
|
|
};
|
2022-05-29 03:30:40 +01:00
|
|
|
};
|
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-10-07 20:26:23 +01:00
|
|
|
(mkMerge [ (vmLVM "shill" "esp") { frontendOpts.bootindex = 0; } ])
|
2022-05-29 15:22:49 +01:00
|
|
|
(vmLVM "shill" "nix")
|
|
|
|
(vmLVM "shill" "persist")
|
2023-02-21 14:22:10 +00:00
|
|
|
{
|
|
|
|
name = "media";
|
|
|
|
backend = {
|
|
|
|
driver = "host_device";
|
|
|
|
filename = "/dev/main/media";
|
|
|
|
discard = "unmap";
|
|
|
|
};
|
|
|
|
format = {
|
|
|
|
driver = "raw";
|
|
|
|
discard = "unmap";
|
|
|
|
};
|
|
|
|
frontend = "virtio-blk";
|
|
|
|
}
|
2022-07-16 15:01:15 +01:00
|
|
|
{
|
|
|
|
name = "minio";
|
|
|
|
backend = {
|
|
|
|
driver = "host_device";
|
2023-02-19 16:47:13 +00:00
|
|
|
filename = "/dev/main/minio";
|
2022-07-16 15:01:15 +01:00
|
|
|
discard = "unmap";
|
|
|
|
};
|
|
|
|
format = {
|
|
|
|
driver = "raw";
|
|
|
|
discard = "unmap";
|
|
|
|
};
|
|
|
|
frontend = "virtio-blk";
|
|
|
|
}
|
2023-11-13 08:14:16 +00:00
|
|
|
{
|
|
|
|
name = "git";
|
|
|
|
backend = {
|
|
|
|
driver = "host_device";
|
|
|
|
filename = "/dev/main/git";
|
|
|
|
discard = "unmap";
|
|
|
|
};
|
|
|
|
format = {
|
|
|
|
driver = "raw";
|
|
|
|
discard = "unmap";
|
|
|
|
};
|
|
|
|
frontend = "virtio-blk";
|
|
|
|
}
|
2022-06-18 03:06:01 +01:00
|
|
|
]);
|
2022-05-28 23:05:30 +01:00
|
|
|
};
|
2022-08-01 17:44:08 +01:00
|
|
|
|
|
|
|
whale2 = {
|
|
|
|
uuid = "6d31b672-1f32-4e2b-a39f-78a5b5e949a0";
|
|
|
|
cpu = "host,topoext";
|
|
|
|
smp = {
|
|
|
|
cpus = 8;
|
|
|
|
threads = 2;
|
|
|
|
};
|
|
|
|
memory = 16384;
|
|
|
|
networks.vms.mac = "52:54:00:d5:d9:c6";
|
|
|
|
cleanShutdown.timeout = 120;
|
|
|
|
drives = [ ] ++ (optionals (!config.my.build.isDevVM) [
|
|
|
|
(mkMerge [ (vmLVM "whale2" "esp") { frontendOpts.bootindex = 0; } ])
|
|
|
|
(vmLVM "whale2" "nix")
|
|
|
|
(vmLVM "whale2" "persist")
|
|
|
|
{
|
|
|
|
name = "oci";
|
|
|
|
backend = {
|
|
|
|
driver = "host_device";
|
2023-02-19 16:47:13 +00:00
|
|
|
filename = "/dev/main/oci";
|
2022-08-01 17:44:08 +01:00
|
|
|
discard = "unmap";
|
|
|
|
};
|
|
|
|
format = {
|
|
|
|
driver = "raw";
|
|
|
|
discard = "unmap";
|
|
|
|
};
|
|
|
|
frontend = "virtio-blk";
|
|
|
|
}
|
|
|
|
]);
|
|
|
|
};
|
2023-08-26 23:26:19 +01:00
|
|
|
|
|
|
|
mail = {
|
|
|
|
uuid = "fd95fe0f-c204-4dd5-b16f-2b808e14a43a";
|
|
|
|
cpu = "host,topoext";
|
|
|
|
smp = {
|
|
|
|
cpus = 3;
|
|
|
|
threads = 2;
|
|
|
|
};
|
|
|
|
memory = 8192;
|
|
|
|
networks.public = {
|
|
|
|
bridge = null;
|
|
|
|
mac = "52:54:00:a8:d1:03";
|
|
|
|
};
|
|
|
|
cleanShutdown.timeout = 120;
|
|
|
|
drives = [
|
|
|
|
(mkMerge [ (vmLVM "mail" "root") { frontendOpts.bootindex = 0; } ])
|
|
|
|
(vmLVM "mail" "data")
|
|
|
|
];
|
|
|
|
};
|
2023-11-11 15:56:27 +00:00
|
|
|
|
|
|
|
darts = {
|
|
|
|
uuid = "ee3882a9-5616-4fcb-83d7-89eb41a84d28";
|
|
|
|
cpu = "host,topoext";
|
|
|
|
smp = {
|
|
|
|
cpus = 4;
|
|
|
|
threads = 2;
|
|
|
|
};
|
|
|
|
memory = 16384;
|
|
|
|
networks.public = {
|
|
|
|
bridge = null;
|
|
|
|
mac = "52:54:00:a8:29:cd";
|
|
|
|
};
|
|
|
|
cleanShutdown.timeout = 120;
|
|
|
|
drives = [
|
|
|
|
(mkMerge [ (vmLVM "darts" "root") { frontendOpts.bootindex = 0; } ])
|
2023-11-13 22:00:02 +00:00
|
|
|
{
|
|
|
|
name = "media";
|
|
|
|
backend = {
|
|
|
|
driver = "host_device";
|
|
|
|
filename = "/dev/main/darts-media";
|
|
|
|
discard = "unmap";
|
|
|
|
};
|
|
|
|
format = {
|
|
|
|
driver = "raw";
|
|
|
|
discard = "unmap";
|
|
|
|
};
|
|
|
|
frontend = "virtio-blk";
|
|
|
|
}
|
2023-11-11 15:56:27 +00:00
|
|
|
];
|
|
|
|
};
|
2022-05-28 23:05:30 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|