From f1685ca38dc0c55056eed0002f194b6081b6339a Mon Sep 17 00:00:00 2001
From: Jan Nieuwenhuizen <janneke@gnu.org>
Date: Fri, 15 Feb 2019 19:13:55 +0100
Subject: [PATCH] services: xorg: Enable override of xserver-arguments.
* gnu/services/xorg.scm (xorg-start-command): Add parameter #:xserver-arguments.
* doc/guix.texi (X Window): Document it.
---
doc/guix.texi | 18 ++++++++++++++++++
gnu/services/xorg.scm | 7 ++++---
2 files changed, 22 insertions(+), 3 deletions(-)
@@ -13123,6 +13123,7 @@ type @code{<sddm-configuration>}.
[#:fonts %default-xorg-fonts] @
[#:configuration-file (xorg-configuration-file @dots{})] @
[#:xorg-server @var{xorg-server}]
+ [#:xserver-arguments '("-nolisten" "tcp")]
Return a @code{startx} script in which @var{modules}, a list of X module
packages, and @var{fonts}, a list of X font directories, are available. See
@code{xorg-wrapper} for more details on the arguments. The result should be
@@ -13131,6 +13132,23 @@ used in place of @code{startx}.
Usually the X server is started by a login manager.
@end deffn
+@cindex -listen tcp
+@cindex -nolisten tcp
+This procedure is useful to override command line options for the X server,
+such as having it listen to over TCP:
+
+@example
+(operating-system
+ ...
+ (services
+ (modify-services %desktop-services
+ (slim-service-type config =>
+ (slim-configuration
+ (inherit config)
+ (startx (xorg-start-command
+ #:xserver-arguments '("-listen" "tcp"))))))))
+@end example
+
@deffn {Scheme Procedure} xorg-configuration-file @
[#:modules %default-xorg-modules] @
[#:fonts %default-xorg-fonts] @
@@ -290,7 +290,8 @@ in place of @code{/usr/bin/X}."
(configuration-file
(xorg-configuration-file #:modules modules
#:fonts fonts))
- (xorg-server xorg-server))
+ (xorg-server xorg-server)
+ (xserver-arguments '("-nolisten" "tcp")))
"Return a @code{startx} script in which @var{modules}, a list of X module
packages, and @var{fonts}, a list of X font directories, are available. See
@code{xorg-wrapper} for more details on the arguments. The result should be
@@ -303,8 +304,8 @@ used in place of @code{startx}."
(define exp
;; Write a small wrapper around the X server.
#~(apply execl #$X #$X ;; Second #$X is for argv[0].
- "-logverbose" "-verbose" "-nolisten" "tcp" "-terminate"
- (cdr (command-line))))
+ "-logverbose" "-verbose" "-terminate" #$@xserver-arguments
+ (cdr (command-line))))
(program-file "startx" exp))
--
2.20.1