Commit graph

109 commits

Author SHA1 Message Date
Eelco Dolstra dddcd10ecc
Don't set 'config.xorg = {}'
This makes memoization of Nixpkgs evaluation less effective, since
some Nixpkgs invocations may have 'config = {}' while others may have
'config = { xorg = {}; }'.

Instead set 'config = {}'.
2018-01-11 19:31:05 +01:00
Jan Tojnar 1d868aa8de
nixos/xserver: Move the keyboard configuration to 00-keyboard.conf
localectl looks for keyboard settings in /X11/xorg.conf.d/00-keyboard.conf

Closes: #29959, #14318
2017-11-30 14:10:34 +01:00
Jan Tojnar c177b838df nixos/xserver: let X choose the xkb rules
With libinput used for keyboard, base rules produce incorrect keyboard
layouts. We are removing the option as recommended in the XKB configuration
guide [1] to let X server choose the ruleset. It looks like it chooses
evdev rules which seem to work for some reason

[1]: https://www.x.org/releases/X11R7.6/doc/xorg-docs/input/XKB-Config.html#id2521360
2017-11-25 10:27:31 +00:00
Maximilian Bosch 410f0f0db2
services.xserver: fix apply of default DM/WM
This is needed to pick the first enabled DM/WM
if the default is `none`
2017-11-07 12:18:24 +01:00
Maximilian Bosch 5b70c1855b
Revert "Revert "services.xserver: assert that either desktop- or window manager is not "none"""
This reverts commit e64dc25434.
2017-11-05 07:32:56 +01:00
Herwig Hochleitner e64dc25434 Revert "services.xserver: assert that either desktop- or window manager is not "none""
This reverts commit 93c54acf97.
This reopens #30517 @nbp @Ma27

Breaking people's config for this is hardly reasonable as is. If it
absolutely cannot be avoided, at the very least, we need to provide
clear instructions on what people need to upgrade in their config. I
actually had to bisect to the commit, to even find out what property I
should change or define, as the error message was useless. It didn't
even mention a property name.

Discussion on the PR seems to be ongoing, so I'm reverting this, so we
don't break people's systems on unstable.
2017-11-05 01:51:13 +01:00
Maximilian Bosch 93c54acf97 services.xserver: assert that either desktop- or window manager is not "none"
resolves #11064
2017-11-04 15:30:20 +01:00
Peter Hoeg 2cd4ebfe93 Revert "display-manager: systemd-udev-settle serves no purpose"
This reverts commit 3571163858.
2017-10-14 14:42:49 +08:00
Peter Hoeg 3571163858 display-manager: systemd-udev-settle serves no purpose 2017-10-14 14:38:04 +08:00
Rostislav Beneš 0cad98dde1
nixos/xserver,gdm: let GDM handle X server verbosity. 2017-09-28 00:18:57 +02:00
aszlig 6e5d2f8963
nixos/xserver: Properly validate XKB options
Checking the keyboard layout has been a long set of hurdles so far, with
several attempts. Originally, the checking was introduced by @lheckemann
in #23709.

The initial implementation just was trying to check whether the symbols/
directory contained the layout name.

Unfortunately, that wasn't enough and keyboard variants weren't
recognized, so if you set layout to eg. "dvorak" it will fail with an
error (#25526).

So my improvement on that was to use sed to filter rules/base.lst and
match the layout against that. I fucked up twice with this, first
because layout can be a comma-separated list which I didn't account for
and second because I ran into a Nix issue (NixOS/nix#1426).

After fixing this, it still wasn't enough (and this is btw. what
localectl also does), because we were *only* matching rules but not
symbols, so using "eu" as a layout won't work either.

I decided now it's the time to actually use libxkbcommon to try
compiling the keyboard options and see whether it succeeds. This comes
in the form of a helper tool called xkbvalidate.

IMHO this approach is a lot less error-prone and we can be sure that we
don't forget about anything because that's what the X server itself uses
to compile the keymap.

Another advantage of this is that we now validate the full set of XKB
options rather than just the layout.

Tested this against a variety of wrong and correct keyboard
configurations and against the "keymap" NixOS VM tests.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Cc: @lheckemann, @peti, @7c6f434c, @tohl, @vcunat, @lluchs
Fixes: #27597
2017-07-28 12:39:55 +02:00
zimbatm 4d545297d8 lib: introduce imap0, imap1 (#25543)
* lib: introduce imap0, imap1

For historical reasons, imap starts counting at 1 and it's not
consistent with the rest of the lib.

So for now we split imap into imap0 that starts counting at zero and
imap1 that starts counting at 1. And imap is marked as deprecated.

See c71e2d4235 (commitcomment-21873221)

* replace uses of lib.imap

* lib: move imap to deprecated.nix
2017-07-04 23:29:23 +01:00
aszlig 69da1807f0
nixos/xserver: Allow more than one keyboard layout
Regression introduced by 44c64fef16.

The services.xserver.layout option allows to specify more than one
layout separated by comma, which the commit above didn't take into
account.

This is very similar to @lheckemann's pull request (#26984) but differs
in the following ways:

  * Print out the full list available layouts (as suggested by @0xABAB
    in [1]).
  * Loop over $layout using the default IFS (and thus no need for
    escaping ${cfg.layout}), because the layouts won't contain white
    spaces.
  * Re-do the error message, which now uses multiple echos instead of a
    heredoc, so the line is wrapped according to the viewers terminal
    width.

I've tested this with several good and bad layouts and also against the
keymap NixOS VM subtests.

[1]: https://github.com/NixOS/nixpkgs/pull/26984#discussion_r125146700

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Fixes: #26961
Closes: #26984
2017-07-03 08:29:20 +02:00
aszlig d97cdfc591
nixos/xserver: Document the layouts sed expression
This was brought up by @0xABAB in #26984 by the following comment:

https://github.com/NixOS/nixpkgs/pull/26984#discussion_r125146405

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2017-07-03 08:29:16 +02:00
aszlig e82d126212
nixos/xserver: Don't use exec in xkb-layouts-exist
First of all, thanks to @pbogdan for getting this problem reproduced:

https://github.com/NixOS/nixpkgs/commit/2014db3efcd2a#commitcomment-22815396

Also thanks to @vcunat for bringing this to my attention:

https://github.com/NixOS/nixpkgs/commit/44c64fef16ed5#commitcomment-22813503

Although it is not entirely clear why Nix has killed the build prior to
finishing, it seems to be related to the process substition I was using.

So instead of using "exec touch", let's wrap this inside an if so we
don't exit too early.

Tested this against all sub-tests in nixos/tests/keymap.nix and also a
few configurations with wrong keyboard layout definitions.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2017-06-28 21:39:19 +02:00
Vladimír Čunát 2014db3efc
nixos xkb-layouts-exist: try to debug on Hydra
I hate having to do this.  We're unable to reproduce the problem locally.
2017-06-28 19:47:51 +02:00
aszlig 44c64fef16
nixos/xserver: Improve checking keyboard layout
Enumerating the symbols directory doesn't include variants, so we're now
basically doing what "localectl list-x11-keymap-layouts" does but we use
sed instead.

The reason I'm not using localectl directly is because the path to
rules/base.lst is hardcoded in the systemd source.

Of course, the XKB specification allows for much more complicated rules,
but at least this should cover the most basic ones including variants.

So the sed expression itself is just for listing the available layouts
and variants and we use a grep with -xF to match only full lines without
interpreting regular expressions.

This should again allow to set "dvorak" as the layout option.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Cc: @lheckemann
Fixes: #25526
2017-06-22 03:24:28 +02:00
aszlig 9dca737d62
Merge pull request #15353 (improve xrandrHeads)
When you have a setup consisting of multiple monitors, the default is
that the first monitor detected by xrandr is set to the primary monitor.

However this may not be the monitor you need to be set as primary. In
fact this monitor set to primary may in fact be disconnected.

This has happened for the original submitter of the pull request and it
affected these programs:

 * XMonad: Gets confused with Super + {w,e,r}
 * SDDM: Puts the login screen on the wrong monitor, and does not
         currently duplicate the login screen on all monitors
 * XMobar: Puts the XMobar on the wrong monitor, as it only puts the
           taskbar on the primary monitor

These changes should fix that not only by setting a primary monitor in
xrandrHeads but also make it possible to make a different monitor the
primary one.

The changes are also backwards-compatible.
2017-05-02 23:14:26 +02:00
aszlig 79e712822f
nixos/xserver: Document xrandrHeads.apply
It was asked by @CMCDragonkai to elaborate on that, so let's just do
this by actually providing a code comment.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2017-04-24 12:02:10 +02:00
aszlig 8266c89b55
nixos/xserver: Fix up/refactor xrandrHeads option
Using invalid module options in the submodule isn't very nice, because
it doesn't give very useful errors in case of type mismatch, also we
don't get descriptions of these options as they're effecively
nonexistent to the module system. Another downside of this is that
merging of these options isn't done correctly as well (eg. for
types.lines).

So we now have proper submodules for each xrandrHead and we also use
corcedTo in the type of xrandrHeads so that we can populate the
submodule's "output" option in case a plain string is defined for a list
item.

Instead of silently skipping multiple primary heads, we now have an
assertion, which displays a message and aborts configuration evaluation
appropriately.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2017-04-24 11:22:55 +02:00
Roger Qiu bb6a5b079f nixos/xserver: Changed xrandrHeads to support corresponding monitor section configuration in Xorg 2017-04-21 22:01:29 +10:00
Linus Heckemann 79872b9e39 Document possibility of multiple keyboard layouts
In services.xserver.layout
2017-03-23 21:15:14 +00:00
Linus Heckemann c5c0459a60 xserver: check that selected layout exists
Fixes #5638
2017-03-23 21:02:38 +00:00
Jaka Hudoklin f5d81ed79b Merge pull request #20904 from offlinehacker/nixos/xserver/xpra
Add xpra display-manager
2017-03-05 01:32:23 +01:00
Vladimír Čunát 31eba21d1d
virtualbox: force xorg-server-1.18 for now
This is getting a little hacky, but hopefully it won't break anything.
2017-02-12 21:07:49 +01:00
Tristan Helmich 24f3abdafb
Revert "Make services.xserver.xkbDir conflict free when overriden."
This reverts commit 82bcfef109.

cc @nbp

Fixes #22290, #22352.

Signed-off-by: Franz Pletz <fpletz@fnordicwalking.de>
2017-02-01 22:37:04 +01:00
Nicolas B. Pierron 82bcfef109 Make services.xserver.xkbDir conflict free when overriden. 2017-01-29 12:24:31 +01:00
Jaka Hudoklin b72f8ccc5c xpra module: add xpra, as xserver display-manager 2016-12-04 22:38:10 +01:00
Joachim Fasting 6977b94e9b
Revert "xserverArgs fuckup"
This reverts commit c2922a9157.

See https://github.com/NixOS/nixpkgs/issues/19930

While the above commit is designed to allow GDM to work, it appears to
break other use cases.  In particular, it breaks tests involving X
usage (e.g., i3wm[1] and firefox[2]), which makes it difficult to assess
the impact of other changes and so hampers development of unrelated
features.

https://hydra.nixos.org/build/42852015
https://hydra.nixos.org/build/42851666
2016-10-28 19:30:12 +02:00
Frederik Rietdijk e56832d730 Merge remote-tracking branch 'upstream/master' into HEAD 2016-10-22 17:23:24 +02:00
Eelco Dolstra e6bcff4d53 display-manager: Require systemd-udev-settle.service
It was already ordered after systemd-udev-settle.service, but that
doesn't do anything if no other units require
systemd-udev-settle.service. This was causing random failures during X
server startup, e.g.

machine# [   12.691372] display-manager[607]: (EE) open /dev/dri/card0: No such file or directory

http://hydra.nixos.org/build/41062823
2016-10-20 17:49:40 +02:00
Alexander Ried c2922a9157 xserverArgs fuckup
gnome-x-session provides good defaults which we really should not
override.
We have to add assertions to gdm.nix if the user specified one of those.

enableTCP must be configured through a gnome setting

dunno why we have terminate but it probably breaks stuff

We should expose configFile so we can use it from gdm module.
2016-10-15 20:32:14 +02:00
zimbatm e026d5b9c8 x11 module: don't restart the display manager indefinitely (#19418)
* x11 module: don't restart the display manager indefinitely

If the display managers crashes continuously in loops it prevents the
user from switching to the console and try to fix things. Especially
when using the "auto" display manager it can happen quite easily.

* x11 module: fix display manager restart timeouts

It takes more than 1 second to boot the X server.
2016-10-10 21:35:37 +01:00
Eelco Dolstra 69bb34673e Merge pull request #19196 from groxxda/xkbbindir
xserver: replace XKB_BINDIR with compile time option
2016-10-03 17:12:59 +02:00
Alexander Ried e7ded267bd xserver: replace XKB_BINDIR with compile time option
---

Using the configure option relieves us of the patch and passing the path
via the env var in many places. Also the env var may not be inherited
when components like gdm spawn new sessions.
2016-10-03 15:03:02 +02:00
Charles Strahan f9a3835a14
nixos: xserver typematic configuration options
This allows one to set the seat defaults for keyboard auto-repeat delay
and rate.
2016-10-03 04:00:06 -04:00
Eelco Dolstra 75a1ec8a65 NixOS: Use runCommand instead of mkDerivation in a few places 2016-09-29 13:05:28 +02:00
Eelco Dolstra 5b5c2fb9c0 Make the default fonts conditional on services.xserver.enable
We were pulling in 44 MiB of fonts in the default configuration, which
is a bit excessive for headless configurations like EC2
instances. Note that dejavu_minimal ensures that remote X11-forwarded
applications still have a basic font regardless.
2016-09-05 15:51:37 +02:00
Gabriel Ebner 22088b4b25 nixos/x11: make nvidia driver work again
The nvidia driver module directly sets the services.xserver.drivers
option, while still having nvidia/nvidiaBeta/... etc. in the
videoDrivers option.
2016-08-06 07:26:25 +02:00
Gabriel Ebner 5e6ac5fcf3 nixos/x11: output sections for modesetting driver
See #17487.
2016-08-05 18:31:04 +02:00
Gabriel Ebner 07fc65289a nixos/x11: remove unneccessary special cases 2016-07-30 17:03:16 +02:00
Gabriel Ebner 5c9309c231 xorg.xorgserver: enable glamor support 2016-07-30 13:37:51 +02:00
Vladimír Čunát a03ff26080 Merge #15639: xorg-server 1.17.4 -> 1.18.3
... and fglrxCompat to maintain compatibility.
2016-06-05 00:52:06 +02:00
Eelco Dolstra d84741a4bf X server: Log to the journal instead of /var/log/X.0.log
This ensures that "journalctl -u display-manager" does what you would
expect in 2016. However, the main reason is to ensure that our VM
tests show the output of the X server.

A slight problem is that with KDE user switching, messages from the
various X servers end up in the same place. However, that's an
improvement over the previous situation, where the second X server
would overwrite the /var/log/X.0.log of the first. (This was caused by
the fact that we were passing a hard-coded value for -logfile.)
2016-05-24 21:45:26 +02:00
Vladimír Čunát 358533dc61 nixos xserver: fix evdev driver with xserver 1.18
... and add its man page.
Now I seem to be running fine with the new server.
2016-05-23 13:02:55 +02:00
Vladimír Čunát 69cc0a7bc5 xf86-input-evdev: split dev output 2016-05-23 13:02:55 +02:00
Eelco Dolstra c7d92f9485 xf86-video-modesetting: Remove
This driver is part of xorg-server now, so we were using an outdated
version.
2016-05-22 23:05:30 +02:00
Christoph Ruegge 769a33bedd xsession: make updating DBus environment optional 2016-04-25 23:37:18 +02:00
Vladimír Čunát 39ebb01d6e Merge branch 'staging', containing closure-size #7701 2016-04-13 09:25:28 +02:00
Eelco Dolstra 9153d8ed64 Fix X11 tests broken by the removal of -ac
Probably missed a few. Also adding xauth to the system path (it was
already in the closure).
2016-04-12 19:13:47 +02:00