This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

superconfig / machines / xerxes / physical.nix
2.6 kB 76 lines
1{ pkgs, ... }: 2{ 3 imports = [ 4 ./disk.nix 5 ./config.nix 6 ./gpd-fan.nix 7 ./gpd-win-mini-2025-pipewire.nix 8 ]; 9 boot.loader.systemd-boot.enable = true; 10 boot.loader.systemd-boot.configurationLimit = 10; 11 boot.loader.efi.canTouchEfiVariables = true; 12 boot.kernelPackages = pkgs.linuxPackages_latest; 13 hardware.graphics.enable = true; 14 15 # Load amdgpu early in initrd for reliable suspend/hibernate resume 16 hardware.amdgpu.initrd.enable = true; 17 18 # Disable Bluetooth USB autosuspend to prevent hardware errors/disconnects 19 # Disable VPE (Video Processing Engine) to fix black screen after suspend/resume 20 # on AMD Strix APUs. VPE fails to reset properly causing IB test timeouts. 21 # https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2065365 22 boot.extraModprobeConfig = '' 23 options btusb enable_autosuspend=0 24 options amdgpu ip_block_mask=0xfffff7ff 25 ''; 26 27 # Disable spurious wakeup sources (PCIe ports triggering immediate wake from s2idle) 28 services.udev.extraRules = '' 29 ACTION=="add", SUBSYSTEM=="pci", DRIVER=="pcieport", ATTR{power/wakeup}="disabled" 30 ''; 31 32 # Swapfile for hibernation (suspend-then-hibernate needs somewhere to dump RAM) 33 swapDevices = [ 34 { 35 device = "/swapfile"; 36 size = 65536; # 64GB to cover full RAM 37 } 38 ]; 39 40 # Resume from swapfile on the root partition 41 boot.resumeDevice = "/dev/disk/by-uuid/e2e38fb5-0cea-4a97-ae56-c2858ae0e07b"; 42 boot.kernelParams = [ 43 "resume_offset=156473344" 44 "amdgpu.gpu_recovery=1" # attempt GPU reset on failure instead of black screen 45 "amdgpu.dcdebugmask=0x10" # disable DSC to prevent GPU hang with external displays 46 ]; 47 48 # Pre-evict VRAM before sleep to prevent amdgpu resume black screen 49 # https://nyanpasu64.gitlab.io/blog/amdgpu-sleep-wake-hang/ 50 systemd.services.amdgpu-sleep = { 51 description = "Evict VRAM before sleep"; 52 before = [ 53 "sleep.target" 54 "suspend.target" 55 "hibernate.target" 56 "suspend-then-hibernate.target" 57 ]; 58 wantedBy = [ 59 "sleep.target" 60 "suspend.target" 61 "hibernate.target" 62 "suspend-then-hibernate.target" 63 ]; 64 unitConfig.StopWhenUnneeded = true; 65 serviceConfig = { 66 Type = "oneshot"; 67 RemainAfterExit = true; 68 ExecStart = "${pkgs.bash}/bin/bash -c 'for f in /sys/kernel/debug/dri/*/amdgpu_evict_vram; do cat \"$f\"; done'"; 69 }; 70 }; 71 72 # s2idle for 15 minutes, then hibernate to save power 73 services.logind.powerKey = "suspend-then-hibernate"; 74 services.logind.lidSwitch = "suspend-then-hibernate"; 75 systemd.sleep.settings.Sleep.HibernateDelaySec = "15min"; 76}