Add baremetal option

This commit is contained in:
Sandro - 2023-05-19 21:38:16 +02:00
parent 04350a3faf
commit 27e567e82c
Signed by: sandro
GPG Key ID: 3AF5A43A3EECC2E5
8 changed files with 35 additions and 35 deletions

View File

@ -63,9 +63,7 @@
git git
htop htop
iotop iotop
lshw
mtr mtr
pciutils # lscpi
pv pv
ripgrep ripgrep
screen screen

View File

@ -744,6 +744,7 @@
./modules/audio-server.nix ./modules/audio-server.nix
./modules/autoupdate.nix ./modules/autoupdate.nix
./modules/backup.nix ./modules/backup.nix
./modules/baremetal.nix
./modules/c3d2.nix ./modules/c3d2.nix
./modules/disko.nix ./modules/disko.nix
./modules/nncp.nix ./modules/nncp.nix

View File

@ -1,4 +1,4 @@
{ config, lib, libS, pkgs, ssh-public-keys, ... }: { config, lib, libS, pkgs, ... }:
let let
cachePort = 5000; cachePort = 5000;
@ -8,10 +8,12 @@ in
./hardware-configuration.nix ./hardware-configuration.nix
./network.nix ./network.nix
./updater.nix ./updater.nix
../../modules/c3d2.nix
]; ];
c3d2.hq.statistics.enable = true; c3d2 = {
baremetal = true;
hq.statistics.enable = true;
};
boot = { boot = {
tmpOnTmpfs = true; tmpOnTmpfs = true;
@ -241,8 +243,6 @@ in
resolved.enable = false; resolved.enable = false;
smartd.enable = true;
zfs.trim.enable = true; zfs.trim.enable = true;
}; };

View File

@ -8,6 +8,7 @@
]; ];
c3d2 = { c3d2 = {
baremetal = true;
deployment.microvmBaseZfsDataset = "server10/vm"; deployment.microvmBaseZfsDataset = "server10/vm";
hq.statistics.enable = true; hq.statistics.enable = true;
}; };
@ -37,16 +38,11 @@
hostId = "10101010"; hostId = "10101010";
}; };
services = { # reserve resources for legacy MicroVMs
openssh.enable = true; services.nomad.settings.client.reserved = {
smartd.enable = true; cpu = 4200;
# see /sys/fs/cgroup/system.slice/system-microvm.slice/memory.current
# reserve resources for legacy MicroVMs memory = 28 * 1024;
nomad.settings.client.reserved = {
cpu = 4200;
# see /sys/fs/cgroup/system.slice/system-microvm.slice/memory.current
memory = 28 * 1024;
};
}; };
simd.arch = "ivybridge"; simd.arch = "ivybridge";

View File

@ -6,6 +6,7 @@
]; ];
c3d2 = { c3d2 = {
baremetal = true;
# deployment.microvmBaseZfsDataset = "tank/storage"; # deployment.microvmBaseZfsDataset = "tank/storage";
hq.statistics.enable = true; hq.statistics.enable = true;
}; };
@ -26,10 +27,6 @@
hostId = "07070707"; hostId = "07070707";
}; };
services = {
smartd.enable = true;
};
simd.arch = "ivybridge"; # E5-2690 v2 simd.arch = "ivybridge"; # E5-2690 v2
sops = { sops = {

View File

@ -6,6 +6,7 @@
]; ];
c3d2 = { c3d2 = {
baremetal = true;
# deployment.microvmBaseZfsDataset = "tank/storage"; # deployment.microvmBaseZfsDataset = "tank/storage";
hq.statistics.enable = true; hq.statistics.enable = true;
}; };
@ -48,15 +49,11 @@
}; };
}; };
openssh.enable = true;
restic.server = { restic.server = {
enable = true; enable = true;
listenAddress = "127.0.0.1:8080"; listenAddress = "127.0.0.1:8080";
privateRepos = true; privateRepos = true;
}; };
smartd.enable = true;
}; };
simd.arch = "westmere"; simd.arch = "westmere";

View File

@ -6,6 +6,7 @@
]; ];
c3d2 = { c3d2 = {
baremetal = true;
deployment.microvmBaseZfsDataset = "tank/storage"; deployment.microvmBaseZfsDataset = "tank/storage";
hq.statistics.enable = true; hq.statistics.enable = true;
}; };
@ -33,15 +34,10 @@
# required by libvirtd # required by libvirtd
security.polkit.enable = true; security.polkit.enable = true;
services = { # reserve resources for libvirt VMs
openssh.enable = true; services.nomad.settings.client.reserved = {
smartd.enable = true; cpu = 2300;
memory = 16 * 1024;
# reserve resources for libvirt VMs
nomad.settings.client.reserved = {
cpu = 2300;
memory = 16 * 1024;
};
}; };
simd.arch = "westmere"; simd.arch = "westmere";
@ -66,7 +62,7 @@
system.stateVersion = "21.11"; system.stateVersion = "21.11";
# XXX: enable for zw-ev and poelzi-ha until we find a better solution # TODO: enable for zw-ev and poelzi-ha until we find a better solution
virtualisation.libvirtd = { virtualisation.libvirtd = {
enable = true; enable = true;
onShutdown = "shutdown"; onShutdown = "shutdown";

15
modules/baremetal.nix Normal file
View File

@ -0,0 +1,15 @@
{ config, lib, pkgs, ... }:
{
options.c3d2.baremetal = lib.mkEnableOption "baremetal";
config = lib.mkIf config.c3d2.baremetal {
environment.systemPackages = with pkgs; [
lshw
pciutils # lscpi
smartmontools # for smartctl
];
services.smartd.enable = true;
};
}