From f703413e41d7cdfbffef841bc03826175cbe71a3 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 6 Nov 2014 23:20:53 +0100 Subject: services: xorg: Allow users to specify the drivers to use. * gnu/services/xorg.scm (xorg-start-command): Add #:drivers parameter. Add 'device-section' procedure, and use it in 'xserver.conf'. * doc/guix.texi (X Window): Document it. --- doc/guix.texi | 9 +++++++++ gnu/services/xorg.scm | 21 +++++++++++++++++---- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 4a596bcbf3..3fbe963967 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -3953,6 +3953,15 @@ password. When @var{auto-login?} is true, log in automatically as @var{default-user}. @end deffn +@deffn {Monadic Procedure} xorg-start-command [#:guile] @ + [#:drivers '()] [#:xorg-server @var{xorg-server}] +Return a derivation that builds a @var{guile} script to start the X server +from @var{xorg-server}. Usually the X server is started by a login manager. + +@var{drivers} must be either the empty list, in which case Xorg chooses a +graphics driver automatically, or a list of driver names that will be tried in +this order---e.g., @code{("modesetting" "vesa")}. +@end deffn @node Setuid Programs @subsection Setuid Programs diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm index 6be94d5614..41e05c9c17 100644 --- a/gnu/services/xorg.scm +++ b/gnu/services/xorg.scm @@ -42,9 +42,21 @@ (define* (xorg-start-command #:key (guile (canonical-package guile-2.0)) - (xorg-server xorg-server)) - "Return a derivation that builds a GUILE script to start the X server from -XORG-SERVER. Usually the X server is started by a login manager." + (xorg-server xorg-server) + (drivers '())) + "Return a derivation that builds a @var{guile} script to start the X server +from @var{xorg-server}. Usually the X server is started by a login manager. + +@var{drivers} must be either the empty list, in which case Xorg chooses a +graphics driver automatically, or a list of driver names that will be tried in +this order---e.g., @code{(\"modesetting\" \"vesa\")}." + + (define (device-section driver) + (string-append " +Section \"Device\" + Identifier \"device-" driver "\" + Driver \"" driver "\" +EndSection")) (define (xserver.conf) (text-file* "xserver.conf" " @@ -69,7 +81,8 @@ EndSection Section \"ServerFlags\" Option \"AllowMouseOpenFail\" \"on\" EndSection -")) +" + (string-join (map device-section drivers) "\n"))) (mlet %store-monad ((config (xserver.conf))) (define script -- cgit 1.4.1