Talk:Games: Difference between revisions

imported>Rapenne-s
No edit summary
imported>Dietr1ch
No edit summary
 
(One intermediate revision by one other user not shown)
Line 6: Line 6:


I agree this page should be deleted, most steam games runs without hack, and for other games, it's mostly the same logic of using steam-run or something like that, we don't need to list them one by one.
I agree this page should be deleted, most steam games runs without hack, and for other games, it's mostly the same logic of using steam-run or something like that, we don't need to list them one by one.
--[[User:Rapenne-s|Rapenne-s]] ([[User talk:Rapenne-s|talk]]) 20:00, 20 October 2022 (UTC)
== Using a games group ==
I've been using a games group to handle permissions to adjust some limits (through gamemoderun usage from steam and lutris/wine)
This is the excerpt of my config. In it's current form it might be helpful to some, but it requires some additional work before it can be added to the Wiki, like diving into the reasoning, and maybe explaining how to use `gamemoderun` on steam and/or other platforms.
<syntaxHighlight lang=nix>
  users.users.dietr1ch = {
    extraGroups = [
      "games"
    ];
  };
</syntaxHighlight>
<syntaxHighlight lang=nix>
  programs = {
    gamemode = {
      enable = true;
      settings = {
        general = {
          inhibit_screensaver = 0;
          renice = 0;
          softrealtime = "auto";
        };
      };
    };
  };
  users.groups = {
    # Users that will play games
    "games" = {
      gid = 666;
    };
  };
  environment = {
    systemPackages = with pkgs; [
      gamemode
    ];
  };
  services = {
    udev = {
      extraRules = ''
        KERNEL=="cpu_dma_latency", GROUP="games"
      '';
    };
  };
  security = {
    sudo = {
      extraRules = [
        {
          groups = [
            "games"
          ];
          commands = [
            {
              command = "${pkgs.gamemode}/bin/gamemoderun";
              options = [ "NOPASSWD" ];
            }
            {
              command = "${pkgs.gamemode}/libexec/cpugovctl";
              options = [ "NOPASSWD" ];
            }
            {
              command = "${pkgs.gamemode}/libexec/gpuclockctl";
              options = [ "NOPASSWD" ];
            }
          ];
        }
      ];
    };
    pam = {
      # Higher resource limits. Used by Lutris/Wine.
      loginLimits = [
        { domain = "@games"; item = "nofile"; type = "soft"; value = "1048576"; }
        { domain = "@games"; item = "nofile"; type = "hard"; value = "1048576"; }
        { domain = "@games"; type = "-"; item = "rtprio"; value = 98; }
        { domain = "@games"; type = "-"; item = "memlock"; value = "unlimited"; }
        { domain = "@games"; type = "-"; item = "nice"; value = -11; }
      ];
    };
  };
</syntaxHighlight>
Return to "Games" page.