{ config, ... }: { # Boot configuration boot = { # Use systemd-boot for UEFI systems loader.systemd-boot.enable = true; loader.efi.canTouchEfiVariables = true; loader.grub.devices = [ config.disko.devices.disk.main.device ]; loader.timeout = 3; # Kernel parameters for server workload kernelParams = [ "rootflags=compress=zstd:1,noatime" ]; kernelModules = [ "nct6775" ]; # Enable KSM for memory efficiency with containers kernel.sysctl = { "kernel.sysrq" = 1; "vm.swappiness" = 10; "net.core.default_qdisc" = "cake"; }; }; hardware.fancontrol = { enable = true; config = '' INTERVAL=10 DEVPATH=hwmon1=devices/pci0000:00/0000:00:02.2/0000:04:00.0/nvme/nvme0 hwmon2=devices/platform/nct6775.656 DEVNAME=hwmon1=nvme hwmon2=nct6798 FCTEMPS=hwmon2/pwm7=hwmon1/temp1_input hwmon2/pwm2=hwmon1/temp1_input FCFANS=hwmon2/pwm7=hwmon2/fan7_input hwmon2/pwm2=hwmon2/fan2_input MINTEMP=hwmon2/pwm7=30 hwmon2/pwm2=30 MAXTEMP=hwmon2/pwm7=60 hwmon2/pwm2=60 MINSTART=hwmon2/pwm7=95 hwmon2/pwm2=150 MINSTOP=hwmon2/pwm7=75 hwmon2/pwm2=0 ''; }; services.hddfancontrol.enable = true; services.hddfancontrol.settings = { harddrives = let devices = config.disko.devices.disk; in { disks = [ devices.parity1.device devices.data1.device devices.data2.device ]; pwmPaths = [ "/sys/class/hwmon/hwmon2/pwm1:20:0" "/sys/class/hwmon/hwmon2/pwm4:80:60" ]; logVerbosity = "DEBUG"; extraArgs = [ "--min-fan-speed-prct=0" ]; }; }; # Btrfs maintenance services.btrfs.autoScrub = { enable = true; interval = "monthly"; fileSystems = [ "/" ]; }; }