Old-materusPC: use nvidia gpu for steam and browser

This commit is contained in:
Mateusz Słodkowicz 2024-05-02 10:15:29 +02:00
parent cff5051f75
commit 7d42994f21
Signed by: materus
SSH Key Fingerprint: SHA256:rzVduzTiiszuYfLPYD0SDZV+g8lxhpcRgpbOZA1X0Uo
2 changed files with 51 additions and 1 deletions

View File

@ -71,7 +71,53 @@
editor.emacs.enable = false; editor.emacs.enable = false;
}; };
xdg.desktopEntries.brave-browser = let env = lib.concatStringsSep " " [
''VK_ICD_FILENAMES=''$VK_ICD_FILENAMES:/run/opengl-driver/share/vulkan/icd.d/nvidia_icd.x86_64.json:/run/opengl-driver-32/share/vulkan/icd.d/nvidia_icd.i686.json''
''__NV_PRIME_RENDER_OFFLOAD="1"''
''__NV_PRIME_RENDER_OFFLOAD_PROVIDER="NVIDIA-G0"''
''__GLX_VENDOR_LIBRARY_NAME="nvidia"''
''__VK_LAYER_NV_optimus="NVIDIA_only"''
];
script = pkgs.writeShellScript "brave" ''
${env} brave "$@"
'';
in
{
name = "Brave Web Browser";
genericName = "Przeglądarka WWW";
comment = "Skorzystaj z internetu";
exec = "${script} %U";
icon = "brave-browser";
terminal = false;
categories = [ "Application" "Network" "WebBrowser" ];
mimeType = [
"application/pdf"
"application/rdf+xml"
"application/rss+xml"
"application/xhtml+xml"
"application/xhtml_xml"
"application/xml"
"image/gif"
"image/jpeg"
"image/png"
"image/webp"
"text/html"
"text/xml"
"x-scheme-handler/http"
"x-scheme-handler/https"
"x-scheme-handler/ipfs"
"x-scheme-handler/ipns"
];
actions.new-windows = {
exec = "${script}";
name = "Nowe okno";
};
actions.new-private-windows = {
exec = "${script} --incognito";
name = "Nowe okno incognito";
};
};
home.packages = [ home.packages = [
pkgs.papirus-icon-theme pkgs.papirus-icon-theme
(materusArg.pkgs.polymc.wrap { extraJDKs = [ pkgs.graalvm-ce ]; }) (materusArg.pkgs.polymc.wrap { extraJDKs = [ pkgs.graalvm-ce ]; })

View File

@ -28,5 +28,9 @@
]; ];
materus.profile.steam.extraEnv = { materus.profile.steam.extraEnv = {
VK_ICD_FILENAMES=''''$VK_ICD_FILENAMES:/run/opengl-driver/share/vulkan/icd.d/nvidia_icd.x86_64.json:/run/opengl-driver-32/share/vulkan/icd.d/nvidia_icd.i686.json''; VK_ICD_FILENAMES=''''$VK_ICD_FILENAMES:/run/opengl-driver/share/vulkan/icd.d/nvidia_icd.x86_64.json:/run/opengl-driver-32/share/vulkan/icd.d/nvidia_icd.i686.json'';
__NV_PRIME_RENDER_OFFLOAD="1";
__NV_PRIME_RENDER_OFFLOAD_PROVIDER="NVIDIA-G0";
__GLX_VENDOR_LIBRARY_NAME="nvidia";
__VK_LAYER_NV_optimus="NVIDIA_only";
}; };
} }