Prevent Sleep on KDE Plasma

So i’ve a desktop computer that i use as a ftp server and also to run some graphical applications using sunshine, but i encounter that after some time the pc won’t no longer accept new connections through sunshine due to nvidia-graphics going to sleep thanks by what i think is KDE-powerdevil utility, to bypass this i installed plasmaoptions for homemanager but the issue persists, i wonder if there is some other config i must tweak to have it running 24/7 without this issue

configuration.nix

   boot.kernelParams = [
         "drm.edid_firmware=HDMI-A-1:edid/daewoo-monitor.bin"
         "video=HDMI-A-1:e"
   ];
   hardware.firmware = [
         (
                 pkgs.runCommandNoCC "daewoo-monitor.bin" { compressFirmware = false; } ''
                         mkdir -p $out/lib/firmware/edid
                         cp ${./daewoo-monitor.bin} $out/lib/firmware/edid/daewoo-monitor.bin
                 ''
         )
   ];
  hardware.nvidia = {
        modesetting.enable = true;
        powerManagement.enable = true;
        powerManagement.finegrained = false;
        open = false;
        nvidiaSettings = true;
        package = config.boot.kernelPackages.nvidiaPackages.stable;
  };

  services.sunshine = {
        enable = true;
        autoStart = true;
        capSysAdmin = true;
        openFirewall = true;
  };

KDE

  services = {
          desktopManager.plasma6.enable = true;
          displayManager.sddm.enable = true;
          displayManager.autoLogin = {
                enable = true;
                user = "carlos";
          };
          displayManager.sddm.wayland.enable = true;
  };

home.nix

{ pkgs, ... }:
{
        home.stateVersion = "25.05";
        programs.plasma = {
                enable = true;
                powerdevil = {
                        AC.autoSuspend.action = "nothing";
                        AC.autoSuspend.idleTimeout = null;
                        AC.dimDisplay.enable = false;
                        AC.turnOffDisplay.idleTimeout = null;
                        AC.turnOffDisplay.idleTimeoutWhenLocked = null;
                        AC.powerProfile = "performance";
                };
                workspace = {
                        splashScreen.theme = "None";
                };
                kscreenlocker = {
                        autoLock = false;
                };
        };
}

I’m not certain but I believe you should be setting this to “never” instead of null, otherwise the configs you posted look good. If that suggestion doesn’t help I would suspect the issue is related to the nvidia settings which I can’t help with.

According to the specification inside plasma-manager i can only set values between 30 and 600000 in seconds

https://nix-community.github.io/plasma-manager/options.xhtml#opt-programs.plasma.powerdevil.AC.turnOffDisplay.idleTimeout

You’ve misread that, it explicitly says the type of that option is either null or “never” or an integer from 30-600000. If you set the option to “never” it will set timeout to -1

Give it a try.

2 Likes

it worked, silly me, thanks for the help