mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 21:38:07 -05:00
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.
This commit is contained in:
parent
e30442b53b
commit
f703413e41
2 changed files with 26 additions and 4 deletions
|
@ -3953,6 +3953,15 @@ password. When @var{auto-login?} is true, log in automatically as
|
||||||
@var{default-user}.
|
@var{default-user}.
|
||||||
@end deffn
|
@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
|
@node Setuid Programs
|
||||||
@subsection Setuid Programs
|
@subsection Setuid Programs
|
||||||
|
|
|
@ -42,9 +42,21 @@ (define-module (gnu services xorg)
|
||||||
|
|
||||||
(define* (xorg-start-command #:key
|
(define* (xorg-start-command #:key
|
||||||
(guile (canonical-package guile-2.0))
|
(guile (canonical-package guile-2.0))
|
||||||
(xorg-server xorg-server))
|
(xorg-server xorg-server)
|
||||||
"Return a derivation that builds a GUILE script to start the X server from
|
(drivers '()))
|
||||||
XORG-SERVER. Usually the X server is started by a login manager."
|
"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)
|
(define (xserver.conf)
|
||||||
(text-file* "xserver.conf" "
|
(text-file* "xserver.conf" "
|
||||||
|
@ -69,7 +81,8 @@ (define (xserver.conf)
|
||||||
Section \"ServerFlags\"
|
Section \"ServerFlags\"
|
||||||
Option \"AllowMouseOpenFail\" \"on\"
|
Option \"AllowMouseOpenFail\" \"on\"
|
||||||
EndSection
|
EndSection
|
||||||
"))
|
"
|
||||||
|
(string-join (map device-section drivers) "\n")))
|
||||||
|
|
||||||
(mlet %store-monad ((config (xserver.conf)))
|
(mlet %store-monad ((config (xserver.conf)))
|
||||||
(define script
|
(define script
|
||||||
|
|
Loading…
Reference in a new issue