Using X without a Display Manager: Difference between revisions

imported>Giraffito
fix typo in shell script
imported>Giraffito
m fix inline code references
Line 1: Line 1:
'''''Please note''': this page is presently being rewritten by someone very new to nixOS, so do not use it as an example of best practices. The previous content of this page was 2 years out of date and factually incorrect.''
'''''Please note''': this page is presently being rewritten by someone very new to nixOS, so do not use it as an example of best practices. The previous content of this page was 2 years out of date and factually incorrect.''


To run X11 as a regular user, ''without'' `services.xserver.enable = true;` in configuration.nix, do the following:
To run X11 as a regular user, ''without'' <code>services.xserver.enable = true;</code> in configuration.nix, do the following:


First, '''install packages'''; you need X11 itself, some X11 input modules (e.g. xf86-input-evdev, xf86-input-synaptics, xf86-input-libinput), and possibly video modules as well (xf86-video-intel, xf86-video-ati, xf86-video-nouveau).
First, '''install packages'''; you need X11 itself, some X11 input modules (e.g. xf86-input-evdev, xf86-input-synaptics, xf86-input-libinput), and possibly video modules as well (xf86-video-intel, xf86-video-ati, xf86-video-nouveau).


You probably want to use '''DRI acceleration''' for X; enable it and OpenGL in /etc/nixos/configuration.nix: `hardware.opengl.enable = true;` and `hardware.opengl.driSupport = true;`.
You probably want to use '''DRI acceleration''' for X; enable it and OpenGL in /etc/nixos/configuration.nix: <code>hardware.opengl.enable = true;</code> and <code>hardware.opengl.driSupport = true;</code>.


Then, it's just necessary to '''gather X configuration files''' into one directory and create a config file that also points X at the correct module paths.
Then, it's just necessary to '''gather X configuration files''' into one directory and create a config file that also points X at the correct module paths.


This script does that (though it hard-codes `pkgs` which should instead be computed from the current configuration):
This script does that (though it hard-codes <code>pkgs</code> which should instead be computed from the current configuration):
<syntaxhighlight lang="sh">
<syntaxhighlight lang="sh">
#!/bin/sh
#!/bin/sh