2022-12-04 08:53:28 +01:00
|
|
|
{ config, ... }:
|
2022-05-14 20:33:56 +02:00
|
|
|
|
|
|
|
{
|
|
|
|
imports = [
|
|
|
|
./hardware-configuration.nix
|
2022-05-15 02:46:14 +02:00
|
|
|
./microvm-staging.nix
|
2023-01-01 02:51:03 +01:00
|
|
|
./znapzend.nix
|
2022-06-12 17:26:32 +02:00
|
|
|
];
|
|
|
|
|
2022-08-05 18:19:12 +02:00
|
|
|
c3d2 = {
|
|
|
|
deployment.microvmBaseZfsDataset = "server10/vm";
|
|
|
|
hq.statistics.enable = true;
|
2022-12-04 04:58:36 +01:00
|
|
|
simd.arch = "ivybridge";
|
2022-08-05 18:19:12 +02:00
|
|
|
};
|
2022-06-12 17:26:32 +02:00
|
|
|
|
2022-11-26 00:34:41 +01:00
|
|
|
boot = {
|
2022-05-14 20:33:56 +02:00
|
|
|
loader.grub = {
|
|
|
|
enable = true;
|
|
|
|
version = 2;
|
|
|
|
device = "/dev/sda";
|
2022-06-12 17:26:32 +02:00
|
|
|
};
|
2022-05-14 20:33:56 +02:00
|
|
|
kernelParams = [
|
|
|
|
"preempt=none"
|
|
|
|
# No server/router runs any untrusted user code
|
|
|
|
"mitigations=off"
|
|
|
|
];
|
2022-05-15 02:46:34 +02:00
|
|
|
tmpOnTmpfs = true;
|
|
|
|
tmpOnTmpfsSize = "80%";
|
2022-06-12 17:26:32 +02:00
|
|
|
};
|
2022-05-14 20:33:56 +02:00
|
|
|
|
|
|
|
networking = {
|
2022-08-05 18:19:12 +02:00
|
|
|
firewall = {
|
|
|
|
enable = true;
|
|
|
|
allowedTCPPorts = [ 22 ];
|
|
|
|
};
|
2022-05-14 20:33:56 +02:00
|
|
|
hostName = "server10";
|
|
|
|
# TODO: change that to something more random
|
|
|
|
hostId = "10101010";
|
2022-06-12 17:26:32 +02:00
|
|
|
};
|
2022-05-14 20:33:56 +02:00
|
|
|
|
2022-08-05 18:19:12 +02:00
|
|
|
services = {
|
|
|
|
openssh.enable = true;
|
|
|
|
smartd.enable = true;
|
|
|
|
zfs.autoScrub.enable = true;
|
2022-12-19 00:12:57 +01:00
|
|
|
|
|
|
|
# reserve resources for legacy MicroVMs
|
|
|
|
nomad.settings.client.reserved = {
|
|
|
|
cpu = 4200;
|
|
|
|
# see /sys/fs/cgroup/system.slice/system-microvm.slice/memory.current
|
2022-12-23 15:58:49 +01:00
|
|
|
memory = 28 * 1024;
|
2022-12-19 00:12:57 +01:00
|
|
|
};
|
2022-05-14 20:33:56 +02:00
|
|
|
};
|
2022-05-17 01:14:05 +02:00
|
|
|
|
2022-12-28 01:45:10 +01:00
|
|
|
sops = {
|
|
|
|
defaultSopsFile = ./secrets.yaml;
|
|
|
|
secrets."machine-id" = {
|
|
|
|
mode = "444";
|
|
|
|
path = "/etc/machine-id";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2022-08-17 20:57:26 +02:00
|
|
|
# static list of microvms from other sources
|
|
|
|
microvm.autostart = [
|
|
|
|
"data-hoarder"
|
|
|
|
"staging-data-hoarder"
|
|
|
|
];
|
2022-11-26 00:34:41 +01:00
|
|
|
skyflake.nomad.client.meta."c3d2.cpuSpeed" = "4";
|
2022-08-17 20:57:26 +02:00
|
|
|
|
2022-05-14 20:33:56 +02:00
|
|
|
system.stateVersion = "21.11"; # Did you read the comment?
|
|
|
|
}
|