nixos-config/machines/okarin/hardware-configuration.nix

71 lines
1.8 KiB
Nix
Raw Normal View History

2023-05-06 10:54:03 +02:00
{ lib, modulesPath, ... }:
{
sbruder.machine.isVm = true;
2023-05-06 10:54:03 +02:00
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";
2023-12-28 23:27:34 +01:00
domains = [ "sbruder.de" ];
2023-05-06 10:54:03 +02:00
address = [ "2001:8d8:1800:8627::1/64" ];
gateway = [ "fe80::1" ];
networkConfig = {
IPv6AcceptRA = "no";
};
};
};
};
}