nixos-config/machines/okarin/hardware-configuration.nix
Simon Bruder 2a5da89f53
Do not enable fwupd on virtual machines
It only uses up resources on those hosts but serves no purpose.
2024-01-01 16:11:28 +01:00

71 lines
1.8 KiB
Nix

{ lib, modulesPath, ... }:
{
sbruder.machine.isVm = true;
boot = {
kernelModules = [ ];
extraModulePackages = [ ];
kernelParams = [ "ip=dhcp" ];
initrd = {
availableKernelModules = [ "aesni_intel" "ahci" "sd_mod" "vmxnet3" "vmw_pvscsi" "vmw_vmci" ];
kernelModules = [ "dm-snapshot" "vmw_balloon" ];
network = {
enable = true; # remote unlocking
# for some reason, the DHCP server does not transmit the static route to the gateway in a form udhcpc understands
# this works around this, but is arguably quite hacky
postCommands = ''
ip route add 10.255.255.1 dev eth0
ip route add default via 10.255.255.1 dev eth0
'';
};
luks.devices."root".device = "/dev/disk/by-uuid/67f2990c-636a-4d80-9f6d-7096fec9e267";
};
loader.grub.device = "/dev/sda";
};
fileSystems = {
"/" = {
device = "/dev/disk/by-uuid/8e3082d1-4af3-4d5d-9fde-d30dc7552d41";
fsType = "btrfs";
options = [ "compress=zstd" "discard" "noatime" ];
};
"/boot" = {
device = "/dev/disk/by-uuid/883c77e8-53bf-4330-bd9e-89ef71ad9518";
fsType = "ext2";
};
};
swapDevices = [
{
device = "/dev/disk/by-partuuid/d9cf5716-25c8-4f72-80e3-696e0dfe1079";
randomEncryption.enable = true;
}
];
zramSwap = {
enable = true;
memoryPercent = 150;
};
networking = {
useDHCP = false;
usePredictableInterfaceNames = false;
};
systemd.network = {
enable = true;
networks = {
eth0 = {
name = "eth0";
DHCP = "yes";
domains = [ "sbruder.de" ];
address = [ "2001:8d8:1800:8627::1/64" ];
gateway = [ "fe80::1" ];
networkConfig = {
IPv6AcceptRA = "no";
};
};
};
};
}