Laptop Performance on NixOS

I’ve been using NixOS for about a month and most of my time configuring NixOS was spent looking for ways to improve my performance, especially when running cpu intense tasks like games and such.
I have an 11th Gen Intel i5-1135G7 (8) @ 4.200GHz CPU and Intel TigerLake-LP GT2 [Iris Xe Graphics] integrated GPU.

My problem lies in the fact that i’m running a dualboot with debian and for some reason, debian just runs way way better than nixos. I am not sure why.

I tried adding an autonice daemon, and due to my skill issue i couldn’t configure it properly (will take some time to learn that later)

services.auto-cpufreq really helped a lot with performance but it is not nearly as close to debian still

my graphics drivers are set to intel, opengl is enabled, gamemode is enabled and i’ve tried messing with around with kernel versions but nothing really worked as well.

at this point i’m lost so i’ll take any advice i can get, since i really wanna move away from the outdated packages from debian

P.S. The way that performance issues work is i’m getting really really good fps for some time and it drops abysmally and the cpu starts working harder (from what i’ve seen on btop) while fans start blowing harder too. Not sure what exactly is going on in the background to make this happen but this has happened on pretty much every distro i’ve tried that isn’t debian (Arch, OpenSUSE, NixOS)

guys please help me i have been at this for the past 4 days and i’ve attempted messing with the kernel and still no luck, also i didn’t clarify that i used specifically mint debian edition instead of regular debian, i don’t know if they have special kernel modules or something

For anyone in the future that is having these issues. i found a solution. It’s just graphics drivers and some cpu management.

  boot.initrd.kernelModules = [ "i915" ];
  boot.kernelModules = [ "kvm-intel" ];
  services.xserver.videoDrivers = [
    "i915"
    "intel"
  ];
  services.thermald.enable = true;

I added these to my hardware-configuration.nix, and pretty much copy pasted the TLP config from the wiki

  hardware.opengl = {
    driSupport = true;
    driSupport32Bit = true;
    enable = true;
    extraPackages = with pkgs; [
      intel-media-driver
      (if (lib.versionOlder (lib.versions.majorMinor lib.version) "23.11") then vaapiIntel else >
      vaapiVdpau
      libvdpau-va-gl
    ];
  };
  environment.sessionVariables = {
    LIBVA_DRIVER_NAME = "iHD";
  };

i also enabled opengl and drivers for it like this (i likely did something wrong but it works for now)

i am not sure if you need this or even want it but i chose to switch to a zen kernel using

boot.kernelPackages = pkgs.linuxPackages_zen;

anyways this did the job for me

1 Like