[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/06: services: Add x11-socket-directory-service-type.
From: |
guix-commits |
Subject: |
01/06: services: Add x11-socket-directory-service-type. |
Date: |
Tue, 21 Mar 2023 20:47:41 -0400 (EDT) |
apteryx pushed a commit to branch master
in repository guix.
commit b7506eb334d1cfceca78682879c69edf525c8ccd
Author: Bruno Victal <mirai@makinata.eu>
AuthorDate: Mon Mar 6 12:35:01 2023 +0000
services: Add x11-socket-directory-service-type.
The x11-socket-directory-service misuses activation-service-type
to create directories. This kind of usage is incorrect since
activation-service-type does not depend on file-systems, hence incompatible
with user defined /tmp mount.
This commit turns x11-socket-directory-service into a shepherd one-shot
service by defining a new x11-socket-directory-service-type.
* gnu/services/desktop.scm (x11-socket-directory-service-type): New
variable.
(x11-socket-directory-service): Deprecate procedure.
(desktop-services-for-system): Use new service-type.
* gnu/tests/lightdm.scm: Ditto.
Reviewed-by: Josselin Poiret <dev@jpoiret.xyz>
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
---
gnu/services/desktop.scm | 44 +++++++++++++++++++++++++++++++++-----------
gnu/tests/lightdm.scm | 2 +-
2 files changed, 34 insertions(+), 12 deletions(-)
diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm
index c0178135b0..e37dbf2827 100644
--- a/gnu/services/desktop.scm
+++ b/gnu/services/desktop.scm
@@ -14,6 +14,7 @@
;;; Copyright © 2020 Reza Alizadeh Majd <r.majd@pantherx.org>
;;; Copyright © 2021 Brice Waegeneire <brice@waegenei.re>
;;; Copyright © 2021, 2022 muradm <mail@muradm.net>
+;;; Copyright © 2023 Bruno Victal <mirai@makinata.eu>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -154,7 +155,8 @@
xfce-desktop-service
xfce-desktop-service-type
- x11-socket-directory-service
+ x11-socket-directory-service ;deprecated
+ x11-socket-directory-service-type
enlightenment-desktop-configuration
enlightenment-desktop-configuration?
@@ -1573,18 +1575,38 @@ rules."
;;; X11 socket directory service
;;;
-(define x11-socket-directory-service
+(define x11-socket-directory-service-type
+ (let ((x11-socket-directory-shepherd-service
+ (shepherd-service
+ (documentation "Create @file{/tmp/.X11-unix} for XWayland.")
+ (requirement '(file-systems))
+ (provision '(x11-socket-directory))
+ (one-shot? #t)
+ (start #~(lambda _
+ (let ((directory "/tmp/.X11-unix"))
+ (mkdir-p directory)
+ (chmod directory #o1777)))))))
+ (service-type
+ (name 'x11-socket-directory-service)
+ (extensions
+ (list
+ (service-extension shepherd-root-service-type
+ (compose
+ list
+ (const x11-socket-directory-shepherd-service)))))
+ (default-value #f) ; no default value required
+ (description
+ "Create @file{/tmp/.X11-unix} for XWayland. When using X11, libxcb
+takes care of creating that directory however, when using XWayland, we
+need to create it beforehand."))))
+
+(define-deprecated x11-socket-directory-service
+ x11-socket-directory-service-type
;; Return a service that creates /tmp/.X11-unix. When using X11, libxcb
;; takes care of creating that directory. However, when using XWayland, we
;; need to create beforehand. Thus, create it unconditionally here.
- (simple-service 'x11-socket-directory
- activation-service-type
- (with-imported-modules '((guix build utils))
- #~(begin
- (use-modules (guix build utils))
- (let ((directory "/tmp/.X11-unix"))
- (mkdir-p directory)
- (chmod directory #o1777))))))
+ (service x11-socket-directory-service-type))
+
;;;
;;; Enlightenment desktop service.
@@ -1889,7 +1911,7 @@ applications needing access to be root.")
(service ntp-service-type)
- x11-socket-directory-service
+ (service x11-socket-directory-service-type)
(service pulseaudio-service-type)
(service alsa-service-type)
diff --git a/gnu/tests/lightdm.scm b/gnu/tests/lightdm.scm
index dda472bd74..6011d2c515 100644
--- a/gnu/tests/lightdm.scm
+++ b/gnu/tests/lightdm.scm
@@ -50,7 +50,7 @@
(service polkit-service-type)
(service elogind-service-type)
(service dbus-root-service-type)
- x11-socket-directory-service))
+ (service x11-socket-directory-service-type)))
(define %lightdm-os
(operating-system
- branch master updated (306bd7b8b9 -> 61e17e2f0d), guix-commits, 2023/03/21
- 02/06: tests: gdm: Remove tmpfs related tests., guix-commits, 2023/03/21
- 03/06: gnu: Add perl-par., guix-commits, 2023/03/21
- 01/06: services: Add x11-socket-directory-service-type.,
guix-commits <=
- 04/06: gnu: Add xforms., guix-commits, 2023/03/21
- 05/06: gnu: Add xforms-gl., guix-commits, 2023/03/21
- 06/06: gnu: Add dozenal., guix-commits, 2023/03/21