mirror of
https://github.com/CHN-beta/nixos.git
synced 2026-01-12 04:39:23 +08:00
enable gamemode
This commit is contained in:
@@ -96,6 +96,7 @@
|
||||
sound.enable = true;
|
||||
prime =
|
||||
{ enable = true; mode = "offload"; busId = { intel = "PCI:0:2:0"; nvidia = "PCI:1:0:0"; };};
|
||||
gamemode.drmDevice = 1;
|
||||
};
|
||||
packages =
|
||||
{
|
||||
|
||||
@@ -14,6 +14,7 @@ inputs:
|
||||
mode = mkOption { type = types.enum [ "offload" "sync" ]; default = "offload"; };
|
||||
busId = mkOption { type = types.attrsOf types.str; default = {}; };
|
||||
};
|
||||
gamemode.drmDevice = mkOption { type = types.int; default = 0; };
|
||||
};
|
||||
config =
|
||||
let
|
||||
@@ -140,5 +141,6 @@ inputs:
|
||||
];
|
||||
}
|
||||
)
|
||||
{ programs.gamemode.settings.gpu.gpu_device = "${toString hardware.gamemode.drmDevice}"; }
|
||||
];
|
||||
}
|
||||
|
||||
@@ -232,6 +232,24 @@ inputs:
|
||||
anime-game-launcher.enable = true;
|
||||
honkers-railway-launcher.enable = true;
|
||||
nix-ld.enable = true;
|
||||
gamemode =
|
||||
{
|
||||
enable = true;
|
||||
settings =
|
||||
{
|
||||
general.renice = 10;
|
||||
gpu =
|
||||
{
|
||||
apply_gpu_optimisations = "accept-responsibility";
|
||||
nv_powermizer_mode = 1;
|
||||
};
|
||||
custom = let notify-send = "${inputs.pkgs.libnotify}/bin/notify-send"; in
|
||||
{
|
||||
start = "${notify-send} 'GameMode started'";
|
||||
end = "${notify-send} 'GameMode ended'";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user