···22{
2324 options = {
25- hardware.bumblebee.enable = mkOption {
26- default = false;
27- type = types.bool;
28- description = ''
29- Enable the bumblebee daemon to manage Optimus hybrid video cards.
30- This should power off secondary GPU until its use is requested
31- by running an application with optirun.
3233- Only nvidia driver is supported so far.
34- '';
35- };
36- hardware.bumblebee.group = mkOption {
37- default = "wheel";
38- example = "video";
39- type = types.str;
40- description = ''Group for bumblebee socket'';
41- };
4243- hardware.bumblebee.connectDisplay = mkOption {
44- default = false;
45- type = types.bool;
46- description = ''
47- Set to true if you intend to connect your discrete card to a
48- monitor. This option will set up your Nvidia card for EDID
49- discovery and to turn on the monitor signal.
5051- Only nvidia driver is supported so far.
52- '';
53- };
00000000000000000000000005455- hardware.bumblebee.driver = mkOption {
56- default = "nvidia";
57- type = types.enum [ "nvidia" "nouveau" ];
58- description = ''
59- Set driver used by bumblebeed. Supported are nouveau and nvidia.
60- '';
61 };
62 };
6364- config = mkIf config.hardware.bumblebee.enable {
65 boot.blacklistedKernelModules = [ "nvidia-drm" "nvidia" "nouveau" ];
66- boot.kernelModules = [ "bbswitch" ];
67- boot.extraModulePackages = [ kernel.bbswitch ] ++ optional useNvidia kernel.nvidia_x11;
6869 environment.systemPackages = [ bumblebee primus ];
70
···22{
2324 options = {
25+ hardware.bumblebee = {
0000002627+ enable = mkOption {
28+ default = false;
29+ type = types.bool;
30+ description = ''
31+ Enable the bumblebee daemon to manage Optimus hybrid video cards.
32+ This should power off secondary GPU until its use is requested
33+ by running an application with optirun.
34+ '';
35+ };
3637+ group = mkOption {
38+ default = "wheel";
39+ example = "video";
40+ type = types.str;
41+ description = ''Group for bumblebee socket'';
42+ };
04344+ connectDisplay = mkOption {
45+ default = false;
46+ type = types.bool;
47+ description = ''
48+ Set to true if you intend to connect your discrete card to a
49+ monitor. This option will set up your Nvidia card for EDID
50+ discovery and to turn on the monitor signal.
51+52+ Only nvidia driver is supported so far.
53+ '';
54+ };
55+56+ driver = mkOption {
57+ default = "nvidia";
58+ type = types.enum [ "nvidia" "nouveau" ];
59+ description = ''
60+ Set driver used by bumblebeed. Supported are nouveau and nvidia.
61+ '';
62+ };
63+64+ bbswitch = mkOption {
65+ default = true;
66+ type = types.bool;
67+ description = ''
68+ Set to true if you want to use bbswitch for power management of
69+ unused card.
70+ '';
71+ };
7200000073 };
74 };
7576+ config = mkIf cfg.enable {
77 boot.blacklistedKernelModules = [ "nvidia-drm" "nvidia" "nouveau" ];
78+ boot.kernelModules = optional cfg.bbswitch [ "bbswitch" ];
79+ boot.extraModulePackages = optional cfg.bbswitch kernel.bbswitch ++ optional useNvidia kernel.nvidia_x11;
8081 environment.systemPackages = [ bumblebee primus ];
82