nixos-config/modules/services/gamemode/default.nix
Alexander "PapaTutuWawa 648da7e05a meta: Various gaming fixes
- Fix Vortex Mod Manager by giving it access to /mnt/Storage (Bad, but
  well)
- Add package: razer-cli
- Tell gamemode to put my GPU in performance mode
- Tell gamemode to enable or disable keyboard backlight
- Switch the miku kernel to Zen
2022-05-03 15:05:19 +02:00

48 lines
1.4 KiB
Nix

{ config, lib, pkgs, ... }:
let
cfg = config.ptw.services.gamemode;
in {
options.ptw.services.gamemode = {
enable = lib.mkEnableOption "Enable and configure gamemode";
};
config = lib.mkIf cfg.enable {
programs.gamemode = {
enable = true;
enableRenice = true;
settings = {
general = {
reaper_freq = 5;
desiredgov = "performance";
igpu_desiredgov = "powersave";
igpu_power_threshold = 0.3;
softrealtime = "on";
renice = 0;
ioprio = 0;
inhibit_screensaver = 1;
};
gpu = {
amd_performance_level = "high";
};
custom = let
razerBrightnessStartScript = pkgs.writeShellScriptBin "razer-brightness-start.sh" ''
${pkgs.razer-cli}/bin/razer-cli -d "Razer BlackWidow Ultimate 2013" -b 1
${pkgs.razer-cli}/bin/razer-cli -d "Razer Tartarus V2" -b 50
'';
razerBrightnessStopScript = pkgs.writeShellScriptBin "razer-brightness-stop.sh" ''
${pkgs.razer-cli}/bin/razer-cli -d "Razer BlackWidow Ultimate 2013" -b 0
${pkgs.razer-cli}/bin/razer-cli -d "Razer Tartarus V2" -b 0
'';
in {
start = ''${razerBrightnessStartScript}/bin/razer-brightness-start.sh'';
end = ''${razerBrightnessStopScript}/bin/razer-brightness-stop.sh'';
};
};
};
};
}