Skip to content

Commit

Permalink
fix: enable enableOffloadCmd in prime.nix only when offload is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Guanran928 authored and mergify[bot] committed Sep 18, 2023
1 parent 504893e commit d53069d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions common/gpu/nvidia/prime.nix
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{ lib, pkgs, ... }:
{ lib, pkgs, config, ... }:

{
imports = [ ./. ];

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
};
Expand Down

2 comments on commit d53069d

@mcdonc
Copy link
Contributor

@mcdonc mcdonc commented on d53069d Oct 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might consider reverting this, as the usage of the shell script harms nothing when the system is not in offload mode, but it's tricky to configure all programs to work properly under both sync and offload mode when the script is not present. For example, with this change, you'll need to have two different steam desktop files, one for when the system is in offload mode, and one for when it is not, whereas before you could just have one single desktop file, and launch steam under nvidia-offload in both sync and offload mode, and it would work fine.

@Mic92
Copy link
Member

@Mic92 Mic92 commented on d53069d Oct 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok.

Please sign in to comment.