services: xorg: Make 'xorg-configuration-file' public.
* gnu/services/xorg.scm (xorg-configuration-file): New procedure, with code formerly in 'xorg-start-command'. (xorg-start-command): Remove #:drivers and #:resolutions; add #:configuration-file; use it as well as 'xorg-configuration-file'.
This commit is contained in:
parent
a4b1a6b65e
commit
d1cdd7ba7a
2 changed files with 35 additions and 17 deletions
|
@ -5250,13 +5250,23 @@ The G-Expression denoting the default SLiM theme and its name.
|
||||||
@end defvr
|
@end defvr
|
||||||
|
|
||||||
@deffn {Monadic Procedure} xorg-start-command [#:guile] @
|
@deffn {Monadic Procedure} xorg-start-command [#:guile] @
|
||||||
[#:drivers '()] [#:resolutions '()] [#:xorg-server @var{xorg-server}]
|
[#:configuration-file #f] [#:xorg-server @var{xorg-server}]
|
||||||
Return a derivation that builds a @var{guile} script to start the X 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.
|
from @var{xorg-server}. @var{configuration-file} is the server configuration
|
||||||
|
file or a derivation that builds it; when omitted, the result of
|
||||||
|
@code{xorg-configuration-file} is used.
|
||||||
|
|
||||||
|
Usually the X server is started by a login manager.
|
||||||
|
@end deffn
|
||||||
|
|
||||||
|
@deffn {Monadic Procedure} xorg-configuration-file @
|
||||||
|
[#:drivers '()] [#:resolutions '()]
|
||||||
|
Return a configuration file for the Xorg server containing search paths for
|
||||||
|
all the common drivers.
|
||||||
|
|
||||||
@var{drivers} must be either the empty list, in which case Xorg chooses a
|
@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
|
graphics driver automatically, or a list of driver names that will be tried in
|
||||||
this order---e.g., @code{("modesetting" "vesa")}.
|
this order---e.g., @code{(\"modesetting\" \"vesa\")}.
|
||||||
|
|
||||||
Likewise, when @var{resolutions} is the empty list, Xorg chooses an
|
Likewise, when @var{resolutions} is the empty list, Xorg chooses an
|
||||||
appropriate screen resolution; otherwise, it must be a list of
|
appropriate screen resolution; otherwise, it must be a list of
|
||||||
|
|
|
@ -37,7 +37,8 @@
|
||||||
#:use-module (srfi srfi-1)
|
#:use-module (srfi srfi-1)
|
||||||
#:use-module (srfi srfi-26)
|
#:use-module (srfi srfi-26)
|
||||||
#:use-module (ice-9 match)
|
#:use-module (ice-9 match)
|
||||||
#:export (xorg-start-command
|
#:export (xorg-configuration-file
|
||||||
|
xorg-start-command
|
||||||
%default-slim-theme
|
%default-slim-theme
|
||||||
%default-slim-theme-name
|
%default-slim-theme-name
|
||||||
slim-service))
|
slim-service))
|
||||||
|
@ -48,12 +49,9 @@
|
||||||
;;;
|
;;;
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
(define* (xorg-start-command #:key
|
(define* (xorg-configuration-file #:key (drivers '()) (resolutions '()))
|
||||||
(guile (canonical-package guile-2.0))
|
"Return a configuration file for the Xorg server containing search paths for
|
||||||
(xorg-server xorg-server)
|
all the common drivers.
|
||||||
(drivers '()) (resolutions '()))
|
|
||||||
"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
|
@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
|
graphics driver automatically, or a list of driver names that will be tried in
|
||||||
|
@ -62,7 +60,6 @@ this order---e.g., @code{(\"modesetting\" \"vesa\")}.
|
||||||
Likewise, when @var{resolutions} is the empty list, Xorg chooses an
|
Likewise, when @var{resolutions} is the empty list, Xorg chooses an
|
||||||
appropriate screen resolution; otherwise, it must be a list of
|
appropriate screen resolution; otherwise, it must be a list of
|
||||||
resolutions---e.g., @code{((1024 768) (640 480))}."
|
resolutions---e.g., @code{((1024 768) (640 480))}."
|
||||||
|
|
||||||
(define (device-section driver)
|
(define (device-section driver)
|
||||||
(string-append "
|
(string-append "
|
||||||
Section \"Device\"
|
Section \"Device\"
|
||||||
|
@ -85,7 +82,6 @@ Section \"Screen\"
|
||||||
EndSubSection
|
EndSubSection
|
||||||
EndSection"))
|
EndSection"))
|
||||||
|
|
||||||
(define (xserver.conf)
|
|
||||||
(text-file* "xserver.conf" "
|
(text-file* "xserver.conf" "
|
||||||
Section \"Files\"
|
Section \"Files\"
|
||||||
FontPath \"" font-adobe75dpi "/share/fonts/X11/75dpi\"
|
FontPath \"" font-adobe75dpi "/share/fonts/X11/75dpi\"
|
||||||
|
@ -116,7 +112,19 @@ EndSection
|
||||||
drivers)
|
drivers)
|
||||||
"\n")))
|
"\n")))
|
||||||
|
|
||||||
(mlet %store-monad ((config (xserver.conf)))
|
(define* (xorg-start-command #:key
|
||||||
|
(guile (canonical-package guile-2.0))
|
||||||
|
configuration-file
|
||||||
|
(xorg-server xorg-server))
|
||||||
|
"Return a derivation that builds a @var{guile} script to start the X server
|
||||||
|
from @var{xorg-server}. @var{configuration-file} is the server configuration
|
||||||
|
file or a derivation that builds it; when omitted, the result of
|
||||||
|
@code{xorg-configuration-file} is used.
|
||||||
|
|
||||||
|
Usually the X server is started by a login manager."
|
||||||
|
(mlet %store-monad ((config (if configuration-file
|
||||||
|
(return configuration-file)
|
||||||
|
(xorg-configuration-file))))
|
||||||
(define script
|
(define script
|
||||||
;; Write a small wrapper around the X server.
|
;; Write a small wrapper around the X server.
|
||||||
#~(begin
|
#~(begin
|
||||||
|
|
Reference in a new issue