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

65 lines
1.6 KiB
Nix

{ lib, modulesPath, ... }:
{
imports = [
(modulesPath + "/profiles/qemu-guest.nix")
];
boot = {
kernelModules = [ ];
extraModulePackages = [ ];
kernelParams = [ "ip=dhcp" ];
initrd = {
availableKernelModules = [ "aesni_intel" "ahci" "sd_mod" "sr_mod" "virtio_pci" "xhci_pci" ];
kernelModules = [ ];
network.enable = true; # remote unlocking
luks.devices."root".device = "/dev/disk/by-uuid/75f9aa9f-bb40-4d83-9f81-18e4f2ce8d57";
};
loader.grub.device = "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi0-0-0-0";
kernel = {
sysctl = {
# Swap should never be used unless the system runs ouf of memory.
"vm.swappiness" = 0;
};
};
};
fileSystems = {
"/" = {
device = "/dev/disk/by-uuid/5905aaff-e4aa-4abd-a1cc-f93acb0762ac";
fsType = "btrfs";
options = [ "compress=zstd" "discard" "noatime" ];
};
"/boot" = {
device = "/dev/disk/by-uuid/07908c38-d35a-4b25-9934-31dd8da9959b";
fsType = "ext2";
};
};
swapDevices = [
{
device = "/dev/disk/by-partuuid/552e77a9-40d1-48e0-9439-0a3c2b506a80";
randomEncryption.enable = true;
}
];
networking = {
useDHCP = false;
usePredictableInterfaceNames = false;
interfaces.eth0 = {
useDHCP = true;
ipv6.addresses = lib.singleton {
address = "2a01:4f8:1c1e:88cd::";
prefixLength = 64;
};
};
defaultGateway6 = {
address = "fe80::1";
interface = "eth0";
};
};
# no smart on qemu disk
services.smartd.enable = false;
}