nixpkgs/pkgs/desktops
Ambroz Bizjak f26153754a nixos/xserver: Implement configuration of NVIDIA Optimus via PRIME
This adds configuration options which automate the configuration of NVIDIA Optimus using PRIME. This allows using the NVIDIA proprietary driver on Optimus laptops, in order to render using the NVIDIA GPU while outputting to displays connected only to the integrated Intel GPU. It also adds an option for enabling kernel modesetting for the NVIDIA driver (via a kernel command line flag); this is particularly useful together with Optimus/PRIME because it fixes tearing on PRIME-connected screens.

The user still needs to enable the Optimus/PRIME feature and specify the bus IDs of the Intel and NVIDIA GPUs, but this is still much easier for users and more reliable. The implementation handles both the X configuration file as well as getting display managers to run certain necessary `xrandr` commands just after X has started.

Configuration of commands run after X startup is done using a new configuration option `services.xserver.displayManager.setupCommands`. Support for this option is implemented for LightDM, GDM and SDDM; all of these have been tested with this feature including logging into a Plasma session.

Note: support of `setupCommands` for GDM is implemented by making GDM run the session executable via a wrapper; the wrapper will run the `setupCommands` before execing. This seemed like the simplest and most reliable approach, and solves running these commands both for GDM's X server and user X servers (GDM starts separate X servers for itself and user sessions). An alternative approach would be with autostart files but that seems harder to set up and less reliable.

Note that some simple features for X configuration file generation (in `xserver.nix`) are added which are used in the implementation:
- `services.xserver.extraConfig`: Allows adding arbitrary new sections. This is used to add the Device section for the Intel GPU.
- `deviceSection` and `screenSection` within `services.xserver.drivers`. This allows the nvidia configuration module to add additional contents into the `Device` and `Screen` sections of the "nvidia" driver, and not into such sections for other drivers that may be enabled.
2018-07-09 18:46:13 +02:00
..
deepin deepin.deepin-terminal: 2.9.2 → 3.0.0 2018-06-19 15:03:46 +02:00
enlightenment enlightenment: add xkeyboard-config dependency (#40690) 2018-05-18 17:28:16 +02:00
gnome-2 gnome2.gtksourceview: fix build on darwin (#41353) 2018-06-01 20:56:40 +02:00
gnome-3 nixos/xserver: Implement configuration of NVIDIA Optimus via PRIME 2018-07-09 18:46:13 +02:00
gnustep Merge remote-tracking branch 'origin/master' into staging 2018-03-28 09:36:47 -04:00
lumina lumina: fix build 2018-03-28 16:25:14 +03:00
lxde/core treewide: remove lintl references 2018-05-16 01:02:31 -05:00
lxqt lxqt.compton-conf: 0.3.0 -> 0.4.0 (#42513) 2018-06-29 23:00:20 +02:00
mate Merge pull request #42490 from r-ryantm/auto-update/mate-system-monitor 2018-06-28 22:03:10 -04:00
maxx maxx: switch to autoPatchelfHook 2018-05-17 22:54:57 +03:00
pantheon/apps/pantheon-terminal pantheon-terminal: fixes #10171 Using the 'memory' GSettings backend 2018-03-27 14:45:40 +02:00
plasma-5 plasma-browser-integration: Init 2018-06-12 22:34:32 +02:00
rox/rox-filer tree-wide: autorename gnome packages to use dashes 2018-02-25 17:41:16 +01:00
xfce Merge remote-tracking branch 'upstream/master' into staging 2018-05-16 15:16:08 -04:00
xfce4-13 xfce4-13: fix build (propagatedNativeBuildInputs) 2018-04-11 23:07:19 +00:00