From d53069def4fb2d92da1ec062b583c088426dc61a Mon Sep 17 00:00:00 2001 From: Guanran928 <68757440+Guanran928@users.noreply.github.com> Date: Sun, 17 Sep 2023 13:52:47 -0600 Subject: [PATCH] fix: enable enableOffloadCmd in prime.nix only when offload is enabled --- common/gpu/nvidia/prime.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/gpu/nvidia/prime.nix b/common/gpu/nvidia/prime.nix index c551389..371e9eb 100644 --- a/common/gpu/nvidia/prime.nix +++ b/common/gpu/nvidia/prime.nix @@ -1,4 +1,4 @@ -{ lib, pkgs, ... }: +{ lib, pkgs, config, ... }: { imports = [ ./. ]; @@ -6,7 +6,7 @@ hardware.nvidia.prime = { offload = { enable = lib.mkOverride 990 true; - enableOffloadCmd = true; # Provides `nvidia-offload` command. + enableOffloadCmd = lib.mkIf config.hardware.nvidia.prime.offload.enable true; # Provides `nvidia-offload` command. }; # Hardware should specify the bus ID for intel/nvidia devices };