GNU bug report logs - #68289
[PATCH] services: xorg: Add xorg-start-command-xinit procedure.

Previous Next

Package: guix-patches;

Reported by: Tomas Volf <~@wolfsden.cz>

Date: Sat, 6 Jan 2024 15:08:02 UTC

Severity: normal

Tags: patch

Done: Arun Isaac <arunisaac <at> systemreboot.net>

Bug is archived. No further changes may be made.

Full log


Message #65 received at 68289 <at> debbugs.gnu.org (full text, mbox):

From: Tomas Volf <~@wolfsden.cz>
To: 68289 <at> debbugs.gnu.org
Cc: arunisaac <at> systemreboot.net, Tomas Volf <~@wolfsden.cz>
Subject: [PATCH v4 1/2] services: xorg: Add startx-command-service-type.
Date: Thu, 30 May 2024 20:29:53 +0200
* gnu/services/xorg.scm (startx-command-profile-service),
(startx-command-service-type): New variables.
(define-module): Export startx-command-service-type.
* doc/guix.texi (X Window): Document it.

Change-Id: Ia2a7c3b2d5ebf6bcfff40cb2640b17d3baf6eba0
---
 doc/guix.texi         | 10 ++++++++++
 gnu/services/xorg.scm | 34 ++++++++++++++++++++++++++++++++++
 2 files changed, 44 insertions(+)

diff --git a/doc/guix.texi b/doc/guix.texi
index b07b8dce6f..2cf1e58b5f 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -23803,6 +23803,16 @@ X Window
 
 @end deftp
 
+@defvar startx-command-service-type
+Add @command{startx} to the system profile putting it onto the
+@env{PATH}.
+
+The value for this service is a @code{<xorg-configuration>} object which
+is passed to the @code{xorg-start-command-xinit} procedure producing the
+@command{startx} used.  Default value is @code{(xorg-configuration)}.
+@end defvar
+
+
 
 @node Printing Services
 @subsection Printing Services
diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm
index 0b9803c425..d29daa59a8 100644
--- a/gnu/services/xorg.scm
+++ b/gnu/services/xorg.scm
@@ -92,6 +92,7 @@ (define-module (gnu services xorg)
             xorg-start-command-xinit
             xinitrc
             xorg-server-service-type
+            startx-command-service-type
 
             %default-slim-theme
             %default-slim-theme-name
@@ -496,6 +497,39 @@ (define* (xorg-start-command-xinit #:optional (config (xorg-configuration)))
 
   (program-file "startx" exp))
 
+(define (startx-command-profile-service config)
+  ;; XXX: profile-service-type only accepts <package> objects.
+  (list
+   (package
+     (name "startx-profile-package")
+     (version "0")
+     (source (xorg-start-command-xinit config))
+     (build-system trivial-build-system)
+     (arguments
+      (list
+       #:modules '((guix build utils))
+       #:builder
+       #~(begin
+           (use-modules (guix build utils))
+           (let ((bin (string-append #$output "/bin")))
+             (mkdir-p bin)
+             (symlink #$source (string-append bin "/startx"))))))
+     (home-page #f)
+     (synopsis #f)
+     (description #f)
+     (license #f))))
+
+(define startx-command-service-type
+  (service-type
+   (name 'startx-command)
+   (extensions
+    (list (service-extension profile-service-type
+                             startx-command-profile-service)))
+   (default-value (xorg-configuration))
+   (description "Add @command{startx} to the system profile.")))
+
+
+
 (define* (xinitrc #:key fallback-session)
   "Return a system-wide xinitrc script that starts the specified X session,
 which should be passed to this script as the first argument.  If not, the
-- 
2.41.0





This bug report was last modified 1 year and 85 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.