bumblebee service: replace bbswitch option with pmMethod
I added this option just today, so I don't think this needs a rename entry.
This commit is contained in:
parent
e4a1b76457
commit
42a180352f
@ -13,6 +13,8 @@ let
|
|||||||
useDisplayDevice = cfg.connectDisplay;
|
useDisplayDevice = cfg.connectDisplay;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
useBbswitch = cfg.pmMethod == "bbswitch";
|
||||||
|
|
||||||
primus = pkgs.primus.override {
|
primus = pkgs.primus.override {
|
||||||
inherit useNvidia;
|
inherit useNvidia;
|
||||||
};
|
};
|
||||||
@ -61,12 +63,11 @@ in
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
bbswitch = mkOption {
|
pmMethod = mkOption {
|
||||||
default = true;
|
default = "auto";
|
||||||
type = types.bool;
|
type = types.enum [ "auto" "bbswitch" "nouveau" "switcheroo" "none" ];
|
||||||
description = ''
|
description = ''
|
||||||
Set to true if you want to use bbswitch for power management of
|
Set preferred power management method for unused card.
|
||||||
unused card.
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -75,8 +76,8 @@ in
|
|||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
boot.blacklistedKernelModules = [ "nvidia-drm" "nvidia" "nouveau" ];
|
boot.blacklistedKernelModules = [ "nvidia-drm" "nvidia" "nouveau" ];
|
||||||
boot.kernelModules = optional cfg.bbswitch [ "bbswitch" ];
|
boot.kernelModules = optional useBbswitch [ "bbswitch" ];
|
||||||
boot.extraModulePackages = optional cfg.bbswitch kernel.bbswitch ++ optional useNvidia kernel.nvidia_x11;
|
boot.extraModulePackages = optional useBbswitch kernel.bbswitch ++ optional useNvidia kernel.nvidia_x11;
|
||||||
|
|
||||||
environment.systemPackages = [ bumblebee primus ];
|
environment.systemPackages = [ bumblebee primus ];
|
||||||
|
|
||||||
@ -85,7 +86,7 @@ in
|
|||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
before = [ "display-manager.service" ];
|
before = [ "display-manager.service" ];
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
ExecStart = "${bumblebee}/bin/bumblebeed --use-syslog -g ${cfg.group} --driver ${cfg.driver}";
|
ExecStart = "${bumblebee}/bin/bumblebeed --use-syslog -g ${cfg.group} --driver ${cfg.driver} --pm-method ${cfg.pmMethod}";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user