mirror of
https://github.com/NixOS/nixos-hardware
synced 2024-11-26 21:09:42 +01:00
chore: replace writeShellScriptBin in prime.nix with enableOffloadCmd
introduced in this commit:
2a7130d13a
This commit is contained in:
parent
0cc0f97212
commit
504893e091
1 changed files with 5 additions and 14 deletions
|
@ -1,22 +1,13 @@
|
|||
{ lib, pkgs, ... }:
|
||||
|
||||
# This creates a new 'nvidia-offload' program that runs the application passed to it on the GPU
|
||||
# As per https://nixos.wiki/wiki/Nvidia
|
||||
let
|
||||
nvidia-offload = pkgs.writeShellScriptBin "nvidia-offload" ''
|
||||
export __NV_PRIME_RENDER_OFFLOAD=1
|
||||
export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0
|
||||
export __GLX_VENDOR_LIBRARY_NAME=nvidia
|
||||
export __VK_LAYER_NV_optimus=NVIDIA_only
|
||||
exec "$@"
|
||||
'';
|
||||
in {
|
||||
{
|
||||
imports = [ ./. ];
|
||||
|
||||
environment.systemPackages = [ nvidia-offload ];
|
||||
|
||||
hardware.nvidia.prime = {
|
||||
offload.enable = lib.mkOverride 990 true;
|
||||
offload = {
|
||||
enable = lib.mkOverride 990 true;
|
||||
enableOffloadCmd = true; # Provides `nvidia-offload` command.
|
||||
};
|
||||
# Hardware should specify the bus ID for intel/nvidia devices
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue