grimm-nixos-laptop/common/gaming.nix

57 lines
1.3 KiB
Nix
Raw Normal View History

2024-04-10 16:51:28 +02:00
{ pkgs, config, lib, ... }:
let
2024-03-24 16:59:47 +01:00
cfg = config.grimmShared;
2024-04-10 16:51:28 +02:00
in
{
2024-03-24 16:59:47 +01:00
config = with cfg; lib.mkIf (enable && gaming) {
programs.steam = {
enable = true;
gamescopeSession.enable = true;
2024-04-10 16:51:28 +02:00
gamescopeSession.env = {
2024-03-24 16:59:47 +01:00
DRI_PRIME = "1";
};
2024-05-04 23:32:31 +02:00
extraCompatPackages = with pkgs; [
proton-ge-bin
];
# extest.enable = true;
2024-03-24 16:59:47 +01:00
};
programs.gamemode = {
enable = true;
settings = {
general = {
2024-04-10 16:51:28 +02:00
inhibit_screensaver = 0;
2024-03-24 16:59:47 +01:00
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-03-24 16:59:47 +01:00
};
services.udev.packages = [ pkgs.wooting-udev-rules ];
environment.sessionVariables = {
2024-04-10 16:51:28 +02:00
GAMEMODERUNEXEC = "env DRI_PRIME=1";
2024-03-24 16:59:47 +01:00
};
environment.systemPackages = with pkgs; [
heroic
prismlauncher
mangohud
2024-05-04 23:32:31 +02:00
the-powder-toy
2024-03-24 16:59:47 +01:00
(pkgs.symlinkJoin {
name = "osu";
paths = [
(pkgs.writeShellScriptBin "osu!" ''exec gamemoderun ${lib.getExe pkgs.osu-lazer-bin}
2024-03-24 16:59:47 +01:00
'')
pkgs.osu-lazer-bin
];
})
];
};
2024-04-27 10:51:53 +02:00
options.grimmShared.gaming = lib.mkEnableOption "enables steam, heroic, prism and gamemoded";
2024-03-24 16:59:47 +01:00
}