Finally get gamescope working properly in Steam

Signed-off-by: magic_rb <magic_rb@redalder.org>
This commit is contained in:
magic_rb 2023-11-25 17:59:48 +01:00
parent 89afaf89c1
commit b284c90451
No known key found for this signature in database
GPG key ID: 08D5287CC5DDCA0E

View file

@ -1,9 +1,18 @@
{ pkgs, lib, ... }:
{ pkgs, lib, config, ... }:
{
programs.gamemode.enable = true;
programs.gamescope = {
enable = true;
capSysNice = true;
# 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";
};
environment.systemPackages = with pkgs; [
@ -18,6 +27,8 @@
p.libkrb5
p.keyutils
];
# 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" ]; });
};
};