enable gamemode

This commit is contained in:
2023-08-21 01:38:14 +08:00
parent 4bae6952ba
commit 403742c4f7
3 changed files with 21 additions and 0 deletions

View File

@@ -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 =
{

View File

@@ -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}"; }
];
}

View File

@@ -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'";
};
};
};
};
}
)