64 lines
1.4 KiB
Nix
64 lines
1.4 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'";
|
|
};
|
|
};
|
|
};
|
|
|
|
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 (factorio.passthru.updateScript != null) factorio;
|
|
};
|
|
|
|
options.grimmShared.gaming = mkEnableOption "enables steam, heroic, prism and gamemoded";
|
|
}
|