File tree Expand file tree Collapse file tree 1 file changed +29
-5
lines changed Expand file tree Collapse file tree 1 file changed +29
-5
lines changed Original file line number Diff line number Diff line change 3
3
{
4
4
imports = [ ./. ] ;
5
5
6
- hardware . nvidia . prime = {
7
- offload = {
8
- enable = lib . mkOverride 990 true ;
9
- enableOffloadCmd = lib . mkIf config . hardware . nvidia . prime . offload . enable true ; # Provides `nvidia-offload` command.
6
+ options = {
7
+ hardware . nvidia . primeBatterySaverSpecialisation = lib . mkEnableOption "configure a specialisation which turns on NVIDIA Prime battery saver" ;
8
+ } ;
9
+
10
+ config = {
11
+
12
+ hardware . nvidia . prime = {
13
+ offload = {
14
+ enable = lib . mkOverride 990 true ;
15
+ enableOffloadCmd = lib . mkIf config . hardware . nvidia . prime . offload . enable true ; # Provides `nvidia-offload` command.
16
+ } ;
17
+ # Hardware should specify the bus ID for intel/nvidia devices
18
+ } ;
19
+
20
+ specialisation = lib . mkIf config . hardware . nvidia . primeBatterySaverSpecialisation {
21
+ battery-saver . configuration = {
22
+ system . nixos . tags = [ "battery-saver" ] ;
23
+ imports = [
24
+ # Leave only the integrated GPU enabled
25
+ ./disable.nix
26
+ ] ;
27
+ hardware . nvidia = {
28
+ prime . offload . enable = lib . mkForce false ;
29
+ powerManagement = {
30
+ enable = lib . mkForce false ;
31
+ finegrained = lib . mkForce false ;
32
+ } ;
33
+ } ;
34
+ } ;
10
35
} ;
11
- # Hardware should specify the bus ID for intel/nvidia devices
12
36
} ;
13
37
}
You can’t perform that action at this time.
0 commit comments