Nvidia: Difference between revisions
imported>Samuela |
imported>Rkitover describe external display specialisation |
||
Line 153: | Line 153: | ||
} | } | ||
</nowiki>}} | </nowiki>}} | ||
==== booting with an external display ==== | |||
Most Optimus laptops have the HDMI port for an external display wired directly to the Nvidia chip, in which case you need a configuration to use the Nvidia driver directly without offload mode. Fortunately, NixOS has an amazing feature called specialisations which allows you to do this easily. Here is an example configuration: | |||
{{file|/etc/nixos/configuration.nix|nix|<nowiki> | |||
specialisation = { | |||
external-display.configuration = { | |||
system.nixos.tags = [ "external-display" ]; | |||
hardware.nvidia.prime.offload.enable = lib.mkForce false; | |||
hardware.nvidia.powerManagement.enable = lib.mkForce false; | |||
}; | |||
}; | |||
</nowiki>}} | |||
Once you rebuild your configuration, an extra <code>external-display</code> configuration will be built and placed in your boot menu. | |||
To use this, boot your laptop with the lid open, choose the <code>external-display</code> configuration in the boot menu, and continue to keep the lid open until your desktop appears on the external display. At this point you can close the lid. | |||
==== sync mode ==== | ==== sync mode ==== |