2024-05-07 23:31:41 +02:00
|
|
|
{
|
|
|
|
pkgs,
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}:
|
2024-04-10 16:51:28 +02:00
|
|
|
let
|
2024-05-11 22:55:59 +02:00
|
|
|
inherit (config.grimmShared) enable gaming;
|
|
|
|
inherit (lib) mkIf getExe mkEnableOption;
|
2024-04-10 16:51:28 +02:00
|
|
|
in
|
|
|
|
{
|
2024-05-11 22:55:59 +02:00
|
|
|
config = mkIf (enable && gaming) {
|
|
|
|
programs.steam = {
|
|
|
|
enable = true;
|
|
|
|
gamescopeSession.enable = true;
|
|
|
|
gamescopeSession.env = {
|
|
|
|
DRI_PRIME = "1";
|
2024-03-24 16:59:47 +01:00
|
|
|
};
|
2024-05-11 22:55:59 +02:00
|
|
|
extraCompatPackages = with pkgs; [ proton-ge-bin ];
|
|
|
|
# extest.enable = true;
|
|
|
|
};
|
2024-03-24 16:59:47 +01:00
|
|
|
|
2024-05-11 22:55:59 +02:00
|
|
|
programs.gamemode = {
|
|
|
|
enable = true;
|
|
|
|
settings = {
|
|
|
|
general = {
|
|
|
|
inhibit_screensaver = 0;
|
|
|
|
renice = 10;
|
|
|
|
};
|
|
|
|
custom = {
|
|
|
|
start = "${lib.getExe pkgs.libnotify} 'GameMode started'";
|
|
|
|
end = "${lib.getExe pkgs.libnotify} 'GameMode ended'";
|
2024-03-24 16:59:47 +01:00
|
|
|
};
|
2024-05-05 13:14:44 +02:00
|
|
|
};
|
2024-05-11 22:55:59 +02:00
|
|
|
};
|
2024-03-24 16:59:47 +01:00
|
|
|
|
2024-05-11 22:55:59 +02:00
|
|
|
services.udev.packages = [ pkgs.wooting-udev-rules ];
|
2024-03-24 16:59:47 +01:00
|
|
|
|
2024-05-11 22:55:59 +02:00
|
|
|
environment.sessionVariables = {
|
|
|
|
GAMEMODERUNEXEC = "env DRI_PRIME=1";
|
2024-05-07 23:31:41 +02:00
|
|
|
};
|
2024-04-16 12:09:17 +02:00
|
|
|
|
2024-05-11 22:55:59 +02:00
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
heroic
|
|
|
|
prismlauncher
|
|
|
|
mangohud
|
|
|
|
the-powder-toy
|
|
|
|
(symlinkJoin {
|
|
|
|
name = "osu";
|
|
|
|
paths = [
|
|
|
|
(writeShellScriptBin "osu!" ''
|
|
|
|
exec gamemoderun ${getExe osu-lazer-bin}
|
|
|
|
'')
|
|
|
|
osu-lazer-bin
|
|
|
|
];
|
|
|
|
})
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
options.grimmShared.gaming = mkEnableOption "enables steam, heroic, prism and gamemoded";
|
2024-03-24 16:59:47 +01:00
|
|
|
}
|