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
htop
iotop
lshw
mtr
pciutils # lscpi
pv
ripgrep
screen

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -6,6 +6,7 @@
];
c3d2 = {
baremetal = true;
deployment.microvmBaseZfsDataset = "tank/storage";
hq.statistics.enable = true;
};
@ -33,15 +34,10 @@
# required by libvirtd
security.polkit.enable = true;
services = {
openssh.enable = true;
smartd.enable = true;
# reserve resources for libvirt VMs
nomad.settings.client.reserved = {
cpu = 2300;
memory = 16 * 1024;
};
# reserve resources for libvirt VMs
services.nomad.settings.client.reserved = {
cpu = 2300;
memory = 16 * 1024;
};
simd.arch = "westmere";
@ -66,7 +62,7 @@
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 = {
enable = true;
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;
};
}