[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
03/03: services: xorg: Allow extra config text to be added verbatim.
From: |
Ludovic Courtès |
Subject: |
03/03: services: xorg: Allow extra config text to be added verbatim. |
Date: |
Thu, 21 May 2015 19:33:40 +0000 |
civodul pushed a commit to branch master
in repository guix.
commit 12422c9d3872f66c4eac5eb65824238c3e09be1a
Author: Ludovic Courtès <address@hidden>
Date: Thu May 21 18:12:28 2015 +0200
services: xorg: Allow extra config text to be added verbatim.
* gnu/services/xorg.scm (xorg-configuration-file): Add #:extra-config and
honor it.
* doc/guix.texi (X Window): Adjust accordingly.
---
doc/guix.texi | 6 +++++-
gnu/services/xorg.scm | 18 +++++++++++++-----
2 files changed, 18 insertions(+), 6 deletions(-)
diff --git a/doc/guix.texi b/doc/guix.texi
index 36e68bb..fd0d29c 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -5260,7 +5260,7 @@ Usually the X server is started by a login manager.
@end deffn
@deffn {Monadic Procedure} xorg-configuration-file @
- [#:drivers '()] [#:resolutions '()]
+ [#:drivers '()] [#:resolutions '()] [#:extra-config '()]
Return a configuration file for the Xorg server containing search paths for
all the common drivers.
@@ -5271,6 +5271,10 @@ this order---e.g., @code{(\"modesetting\" \"vesa\")}.
Likewise, when @var{resolutions} is the empty list, Xorg chooses an
appropriate screen resolution; otherwise, it must be a list of
resolutions---e.g., @code{((1024 768) (640 480))}.
+
+Last, @var{extra-config} is a list of strings or objects appended to the
address@hidden argument list. It is used to pass extra text to be added
+verbatim to the configuration file.
@end deffn
@node Desktop Services
diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm
index a9afa2f..e43bfcf 100644
--- a/gnu/services/xorg.scm
+++ b/gnu/services/xorg.scm
@@ -49,7 +49,8 @@
;;;
;;; Code:
-(define* (xorg-configuration-file #:key (drivers '()) (resolutions '()))
+(define* (xorg-configuration-file #:key (drivers '()) (resolutions '())
+ (extra-config '()))
"Return a configuration file for the Xorg server containing search paths for
all the common drivers.
@@ -59,7 +60,11 @@ this order---e.g., @code{(\"modesetting\" \"vesa\")}.
Likewise, when @var{resolutions} is the empty list, Xorg chooses an
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))}.
+
+Last, @var{extra-config} is a list of strings or objects appended to the
address@hidden argument list. It is used to pass extra text to be added
+verbatim to the configuration file."
(define (device-section driver)
(string-append "
Section \"Device\"
@@ -82,7 +87,7 @@ Section \"Screen\"
EndSubSection
EndSection"))
- (text-file* "xserver.conf" "
+ (apply text-file* "xserver.conf" "
Section \"Files\"
FontPath \"" font-adobe75dpi "/share/fonts/X11/75dpi\"
ModulePath \"" xf86-video-vesa "/lib/xorg/modules/drivers\"
@@ -107,10 +112,13 @@ Section \"ServerFlags\"
Option \"AllowMouseOpenFail\" \"on\"
EndSection
"
- (string-join (map device-section drivers) "\n")
+ (string-join (map device-section drivers) "\n") "\n"
(string-join (map (cut screen-section <> resolutions)
drivers)
- "\n")))
+ "\n")
+
+ "\n"
+ extra-config))
(define* (xorg-start-command #:key
(guile (canonical-package guile-2.0))