{ pkgs, ... }: let qubesnsh = pkgs.writeTextFile { name = "qubes.nsh"; text = "HD1f65535a1:EFI\\qubes\\grubx64.efi"; }; in { boot = { kernelParams = [ "processor.max_cstate=1" # Fixes bug where ryzen cpus freeze when in highest C state "clearcpuid=514" "amdgpu.ppfeaturemask=0xfffd3fff" # Fixes amdgpu freezing ]; # QubesOS boot entry loader.systemd-boot = { extraFiles = { "efi/edk2-shell/shell.efi" = "${pkgs.edk2-uefi-shell}/shell.efi"; "qubes.nsh" = qubesnsh; }; extraEntries."qubes.conf" = '' title Qubes OS efi /efi/edk2-shell/shell.efi options -nointerrupt qubes.nsh sort-key ab ''; }; }; systemd.services.disable-gpp0-wakeup = { description = "Disable GPP0 wakeup trigger to fix Aorus B550 sleep"; wantedBy = [ "multi-user.target" ]; serviceConfig = { Type = "oneshot"; ExecStart = "${pkgs.bash}/bin/bash -c 'if grep -q \"GPP0.*enabled\" /proc/acpi/wakeup; then echo GPP0 > /proc/acpi/wakeup; fi'"; RemainAfterExit = true; }; }; }