Enabling Nvidia Power Management means I can say Goodbye Windows 10

2025-11-15

I've been using NixOS on my laptop for many years now as my daily driver and overall the experience has been positive. It has its bumps, its quirks, and many moments of cursing and pain when writing new modules, but I wouldn't trade it for another distro. The declarative configuration, however obtuse, tickles that infrastructure as code part of my brain. My device configurations deployed with a single command with changes tracked in git? Count me in!

Despite my desire to declare all the things via a config file, my personal desktop has been stuck on Windows 10 for years. It was my backup "just works" system, a system where I could play games using horrible system-level anti-cheat software, and somewhere I could test bleeding edge versions of programs ad-hoc without the need for writing an overlay and sudo nixos-rebuild switch-ing. One by one the reasons I'd been sticking with Windows 10 dwindled away, and now that EoS has arrived it's time to make the jump.

The last holdout to my migration was nothing to do with Windows itself, but with NixOS refusing to function properly on my system. My desktop is no slouch, it's packing a Ryzen 5800x and an Nvidia RTX 3070, more than enough to run any modern OS. I've had NixOS installed in a dual-boot for the last two years waiting to make the switch, but an issue with the Nvidia driver causing total screen corruption when awaking from sleep/suspend made the system unusable.

Screen corruption after resuming from suspend

Turns out, this wound was self-inflicted. This was how I configured the Nvidia driver on my system:

  hardware.nvidia = {
    modesetting.enable = true;
    powerManagement.enable = false;
    powerManagement.finegrained = false;
    nvidiaSettings = true;
    open = true;
  };

powerManagement.enable = false was my downfall. Enabling it configures the driver to use the "experimental" power management interface, which can be used to integrate nicely with systemd. The NixOS module description wasn't clear on the benefits of using this option, and the option defaults to false:

Whether to enable experimental power management through systemd. For more information, see the NVIDIA docs, on Chapter 21. Configuring Power Management Support .

"Why would I want to enable an experimental interface?" Turns out, if you want to use systemd-suspend (like KDE does), you need to.

  hardware.nvidia = {
    modesetting.enable = true;
-    powerManagement.enable = false;
+    powerManagement.enable = true;
    powerManagement.finegrained = false;
    nvidiaSettings = true;
    open = true;
  };

A one-line change meant the difference between "system that works for five minutes" and "system that works".

Though, now I can finally say "Bye Windows 10, it was nice while it lasted."