forked from c3d2/nix-config
Add baremetal option
This commit is contained in:
parent
04350a3faf
commit
27e567e82c
|
@ -63,9 +63,7 @@
|
||||||
git
|
git
|
||||||
htop
|
htop
|
||||||
iotop
|
iotop
|
||||||
lshw
|
|
||||||
mtr
|
mtr
|
||||||
pciutils # lscpi
|
|
||||||
pv
|
pv
|
||||||
ripgrep
|
ripgrep
|
||||||
screen
|
screen
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -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,17 +38,12 @@
|
||||||
hostId = "10101010";
|
hostId = "10101010";
|
||||||
};
|
};
|
||||||
|
|
||||||
services = {
|
|
||||||
openssh.enable = true;
|
|
||||||
smartd.enable = true;
|
|
||||||
|
|
||||||
# reserve resources for legacy MicroVMs
|
# reserve resources for legacy MicroVMs
|
||||||
nomad.settings.client.reserved = {
|
services.nomad.settings.client.reserved = {
|
||||||
cpu = 4200;
|
cpu = 4200;
|
||||||
# see /sys/fs/cgroup/system.slice/system-microvm.slice/memory.current
|
# see /sys/fs/cgroup/system.slice/system-microvm.slice/memory.current
|
||||||
memory = 28 * 1024;
|
memory = 28 * 1024;
|
||||||
};
|
};
|
||||||
};
|
|
||||||
|
|
||||||
simd.arch = "ivybridge";
|
simd.arch = "ivybridge";
|
||||||
|
|
||||||
|
|
|
@ -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 = {
|
||||||
|
|
|
@ -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";
|
||||||
|
|
|
@ -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,16 +34,11 @@
|
||||||
# required by libvirtd
|
# required by libvirtd
|
||||||
security.polkit.enable = true;
|
security.polkit.enable = true;
|
||||||
|
|
||||||
services = {
|
|
||||||
openssh.enable = true;
|
|
||||||
smartd.enable = true;
|
|
||||||
|
|
||||||
# reserve resources for libvirt VMs
|
# reserve resources for libvirt VMs
|
||||||
nomad.settings.client.reserved = {
|
services.nomad.settings.client.reserved = {
|
||||||
cpu = 2300;
|
cpu = 2300;
|
||||||
memory = 16 * 1024;
|
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
15
modules/baremetal.nix
Normal 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;
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user