Question about gamemode / gamemoderun and polkit interaction

When launching a game with gamemoderun %command% in steam, I get polkit prompts for Authentication is needed to run "nix/store/g2sa1cz0m673a823fi5s49k651abjzwc-gamemode-1.8.2/cpugovctl set performance" as the superuser and Authentication is needed to run "nix/store/g2sa1cz0m673a823fi5s49k651abjzwc-gamemode-1.8.2/procsysctl split_lock_mitigation=0" as the superuser , along with Polkit prompts to change them back after the program closes.

The polkit prompts appear and disappear faster than I can input my password, and ideally, I wouldn’t need to put the password in each time it needs to make those changes.

Is there anyway to make it so it doesn’t prompt and just auto applies, or make it so the prompt sticks around longer? Thanks for any help

I have steam installed via my configuration file and not via a flatpak. I am using flakes and Hyprland. Also, I have my user in the “gamemode” group. I am
Running NixOS 25.05.20250102.6df2492 with Kernel: x86_64 Linux 6.6.68

How did you install and set up gamemode?

Via the configuration file as well

Snippet of my gamemode section:

programs = {
 gamemode = {
  enable = true;
  enableRenice = true;

  settings = {
    general = {
      renice = 10;
    };
    custom = {
      start = "${pkgs.libnotify}/bin/notify-send 'GameMode started'";
      end = "${pkgs.libnotify}/bin/notify-send 'GameMode ended'";
    };
  };
};

Ok, I am dumb, I figured it out, I had this in my config to fix some old issue I can’t even remember. Commenting out this made the polkit prompts disappeared.

systemd = {
 user.services.polkit-gnome-authentication-agent-1 = {
  description = "polkit-gnome-authentication-agent-1";
  wantedBy = ["graphical-session.target"];
  wants = ["graphical-session.target"];
  after = ["graphical-session.target"];
  serviceConfig = {
    Type = "simple";
    ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
    Restart = "on-failure";
    RestartSec = 1;
    TimeoutStopSec = 10;
  };
};
1 Like