74 lines
1.5 KiB
Nix
74 lines
1.5 KiB
Nix
{
|
|
pkgs,
|
|
config,
|
|
lib,
|
|
...
|
|
}:
|
|
let
|
|
inherit (config.grimmShared) enable gaming;
|
|
inherit (lib)
|
|
mkIf
|
|
getExe
|
|
mkEnableOption
|
|
optional
|
|
;
|
|
in
|
|
{
|
|
config = mkIf (enable && gaming) {
|
|
programs.steam = {
|
|
enable = true;
|
|
gamescopeSession.enable = true;
|
|
gamescopeSession.env = {
|
|
DRI_PRIME = "1";
|
|
};
|
|
extraCompatPackages = with pkgs; [ proton-ge-bin ];
|
|
# extest.enable = true;
|
|
};
|
|
|
|
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'";
|
|
};
|
|
};
|
|
};
|
|
|
|
programs.honkers-railway-launcher.enable = true;
|
|
|
|
services.udev.packages = [ pkgs.wooting-udev-rules ];
|
|
|
|
environment.sessionVariables = {
|
|
GAMEMODERUNEXEC = "env DRI_PRIME=1";
|
|
};
|
|
|
|
environment.systemPackages =
|
|
with pkgs;
|
|
[
|
|
heroic
|
|
prismlauncher
|
|
mangohud
|
|
the-powder-toy
|
|
factorio
|
|
pactorio
|
|
(symlinkJoin {
|
|
name = "osu";
|
|
paths = [
|
|
(writeShellScriptBin "osu!" ''
|
|
exec gamemoderun ${getExe osu-lazer-bin}
|
|
'')
|
|
osu-lazer-bin
|
|
];
|
|
})
|
|
]
|
|
++ optional (!isNull factorio.passthru.updateScript) factorio;
|
|
};
|
|
|
|
options.grimmShared.gaming = mkEnableOption "enables steam, heroic, prism and gamemoded";
|
|
}
|