2023-11-25 17:59:48 +01:00
|
|
|
{ pkgs, lib, config, ... }:
|
2023-06-11 23:09:59 +02:00
|
|
|
{
|
|
|
|
programs.gamemode.enable = true;
|
2023-11-24 15:24:36 +01:00
|
|
|
programs.gamescope = {
|
|
|
|
enable = true;
|
2023-11-25 17:59:48 +01:00
|
|
|
# Wrappers don't work in steams FHSEnv cause security reasons (ig valid)
|
|
|
|
capSysNice = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
# Therefore we wrap gamescope with the capability under an alias
|
|
|
|
security.wrappers.gamescope-nice = {
|
|
|
|
owner = "root";
|
|
|
|
group = "root";
|
|
|
|
source = "${pkgs.gamescope}/bin/gamescope";
|
|
|
|
capabilities = "cap_sys_nice+pie";
|
2023-11-24 15:24:36 +01:00
|
|
|
};
|
2023-06-11 23:09:59 +02:00
|
|
|
|
2023-07-27 21:00:44 +02:00
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
mangohud
|
2023-06-11 23:09:59 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
programs.steam = {
|
|
|
|
enable = true;
|
|
|
|
remotePlay.openFirewall = true;
|
2023-07-09 23:43:50 +02:00
|
|
|
package = pkgs.steam-small.override {
|
|
|
|
extraLibraries = p: with p; [
|
|
|
|
p.libkrb5
|
|
|
|
p.keyutils
|
|
|
|
];
|
2023-11-25 17:59:48 +01:00
|
|
|
# this is the worst thing I have written in ages, but it works
|
|
|
|
buildFHSEnv = x: pkgs.buildFHSEnv (x // { extraBwrapArgs = x.extraBwrapArgs ++ [ "--cap-add CAP_SYS_NICE --cap-add CAP_SETPCAP" ]; });
|
2023-07-09 23:43:50 +02:00
|
|
|
};
|
2023-06-11 23:09:59 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
services.udev.extraRules = ''
|
2023-09-16 16:41:21 +02:00
|
|
|
ACTION=="add", SUBSYSTEM=="block", ENV{ID_PART_ENTRY_UUID}=="a7588d17-2c04-4bb7-8c10-b2aaeed1826c" RUN{program}+="${pkgs.systemd}/bin/systemd-mount --no-block $devnode /media/steam_library/1"
|
|
|
|
ACTION=="remove", SUBSYSTEM=="block", ENV{ID_PART_ENTRY_UUID}=="a7588d17-2c04-4bb7-8c10-b2aaeed1826c" RUN{program}+="${pkgs.systemd}/bin/systemctl stop media-steam_library-1.mount"
|
|
|
|
ACTION=="add", SUBSYSTEM=="block", ENV{ID_PART_ENTRY_UUID}=="89910513-3f2d-4b49-bf0d-ec667d532c61" RUN{program}+="${pkgs.systemd}/bin/systemd-mount --no-block $devnode /media/steam_library/2"
|
|
|
|
ACTION=="remove", SUBSYSTEM=="block", ENV{ID_PART_ENTRY_UUID}=="89910513-3f2d-4b49-bf0d-ec667d532c61" RUN{program}+="${pkgs.systemd}/bin/systemctl stop media-steam_library-2.mount"
|
2023-06-11 23:09:59 +02:00
|
|
|
'';
|
|
|
|
}
|