From 2e72caad365c9fede3aac93fde973bf37e837ce3 Mon Sep 17 00:00:00 2001 From: Adrian G L Date: Fri, 26 Sep 2025 09:42:29 +0200 Subject: [PATCH] tried fixing freezes --- hosts/legolas/hardware-configuration.nix | 85 +++++++++++------------- 1 file changed, 39 insertions(+), 46 deletions(-) diff --git a/hosts/legolas/hardware-configuration.nix b/hosts/legolas/hardware-configuration.nix index f178076..dd13fdb 100644 --- a/hosts/legolas/hardware-configuration.nix +++ b/hosts/legolas/hardware-configuration.nix @@ -1,76 +1,69 @@ -# Do not modify this file! It was generated by ‘nixos-generate-config’ -# and may be overwritten by future invocations. Please make changes -# to /etc/nixos/configuration.nix instead. -{ - config, - lib, - pkgs, - modulesPath, - ... -}: +{ config, lib, pkgs, modulesPath, ... }: { imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - #boot.kernelPackages = pkgs.linuxPackages_xanmod_latest; - #boot.kernelPackages = pkgs.linuxPackages_latest; boot.kernelPackages = pkgs.linuxPackages_zen; - boot.initrd.availableKernelModules = [ - "xhci_pci" - "nvme" - "uas" - "rtsx_pci_sdmmc" + boot.kernelParams = [ + "nvme_core.default_ps_max_latency_us=0" + "pcie_aspm=off" + "pcie_port_pm=off" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "uas" "rtsx_pci_sdmmc" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; fileSystems."/" = { device = "/dev/disk/by-label/NIXROOT"; fsType = "ext4"; }; - boot.initrd.luks.devices = { - "luks_secure" = { - device = "/dev/disk/by-uuid/c21c8089-29a7-4266-a8a6-6e80ccca167c"; - #preLVM = true; - #allowDiscards = true; - crypttabExtraOpts = [ - "tpm2-device=auto" - "tpm2-measure-pcr=yes" - ]; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-label/NIXBOOT"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; + + boot.initrd.luks.devices.luks_secure = { + device = "/dev/disk/by-uuid/c21c8089-29a7-4266-a8a6-6e80ccca167c"; + crypttabExtraOpts = [ + "tpm2-device=auto" + "tpm2-measure-pcr=yes" + ]; }; - - services.logind.lidSwitch = "suspend-then-hibernate"; - powerManagement.enable = true; swapDevices = [ { device = "/swapfile"; size = 98 * 1024; # 32GB in MB } + ]; - fileSystems."/boot" = { - device = "/dev/disk/by-label/NIXBOOT"; - fsType = "vfat"; - options = [ - "fmask=0022" - "dmask=0022" - ]; + boot.kernel.sysctl = { + "vm.swappiness" = 10; }; + services.logind.lidSwitch = "suspend-then-hibernate"; + powerManagement.enable = true; + hardware.graphics = { - enable = true; - extraPackages = with pkgs; [ - vpl-gpu-rt - intel-media-sdk - ]; + enable = true; + extraPackages = with pkgs; [ vpl-gpu-rt intel-media-sdk ]; }; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; - } + + + + + + + + +