nixos: gaming: gamemode: integrate with offloading
This commit is contained in:
parent
c0178f4393
commit
5cd54c4323
1 changed files with 13 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
myFlake.hardware.accessories.xboxOneController.enable = lib.mkDefault true;
|
||||
|
@ -13,6 +14,18 @@
|
|||
};
|
||||
};
|
||||
|
||||
# Integrate with NVIDIA Optimus offloading.
|
||||
# https://github.com/FeralInteractive/gamemode#note-for-hybrid-gpu-users
|
||||
# https://github.com/NixOS/nixpkgs/pull/273177
|
||||
environment.sessionVariables = {
|
||||
"GAMEMODERUNEXEC" = let
|
||||
inherit (config.hardware.nvidia.prime) offload;
|
||||
in
|
||||
lib.mkIf
|
||||
(builtins.elem "nvidia" config.services.xserver.videoDrivers || offload.enable || offload.enableOffloadCmd)
|
||||
(lib.mkDefault "nvidia-offload");
|
||||
};
|
||||
|
||||
### https://wiki.archlinux.org/title/Gaming#Improving_performance
|
||||
systemd.tmpfiles.rules = [
|
||||
# Path Mode UID GID Age Argument
|
||||
|
|
Loading…
Reference in a new issue