gpu settings

This commit is contained in:
2026-08-29 16:14:32 +09:00
parent 2cb7e76ca1
commit 9a38e9f614
5 changed files with 39 additions and 60 deletions
+28 -7
View File
@@ -1,19 +1,40 @@
_: {
{
config,
lib,
pkgs,
...
}:
let
chrome = pkgs.google-chrome.overrideAttrs (old: {
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.makeWrapper ];
postFixup = (old.postFixup or "") + ''
wrapProgram $out/bin/google-chrome-stable \
--set LIBVA_DRIVER_NAME nvidia \
--set NVD_BACKEND direct
'';
});
features = [
"MiddleClickAutoscroll"
"AcceleratedVideoDecoder"
"AcceleratedVideoDecodeLinuxGL"
"PlatformHEVCDecoderSupport"
]
++ lib.optional config.my.hardwares.nvidia.enable "VaapiOnNvidiaGPUs";
in
{
programs.google-chrome = {
enable = true;
package = if config.my.hardwares.nvidia.enable then chrome else pkgs.google-chrome;
commandLineArgs = [
"--enable-features=MiddleClickAutoscroll,AcceleratedVideoDecoder,AcceleratedVideoDecodeLinuxGL,VaapiOnNvidiaGPUs,PlatformHEVCDecoderSupport"
"--enable-features=${lib.concatStringsSep "," features}"
"--use-gl=angle"
"--use-angle=gl"
];
};
home.sessionVariables = {
LIBVA_DRIVER_NAME = "nvidia";
NVD_BACKEND = "direct";
};
xdg.mimeApps = {
enable = true;