[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#49969] [PATCH v4 05/10] gnu: desktop: Add seatd-service-type
From: |
muradm |
Subject: |
[bug#49969] [PATCH v4 05/10] gnu: desktop: Add seatd-service-type |
Date: |
Thu, 19 Aug 2021 17:39:01 +0300 |
* gnu/services/desktop.scm: Add seatd-service-type
---
gnu/services/desktop.scm | 60 +++++++++++++++++++++++++++++++++++++++-
1 file changed, 59 insertions(+), 1 deletion(-)
diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm
index 64d0e85301..c42db5987e 100644
--- a/gnu/services/desktop.scm
+++ b/gnu/services/desktop.scm
@@ -13,6 +13,7 @@
;;; Copyright © 2020 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2020 Reza Alizadeh Majd <r.majd@pantherx.org>
;;; Copyright © 2021 Brice Waegeneire <brice@waegenei.re>
+;;; Copyright © 2021 muradm <mail@muradm.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -39,7 +40,9 @@
#:use-module (gnu services networking)
#:use-module (gnu services sound)
#:use-module ((gnu system file-systems)
- #:select (%elogind-file-systems file-system))
+ #:select (%control-groups
+ %elogind-file-systems
+ file-system))
#:use-module (gnu system)
#:use-module (gnu system setuid)
#:use-module (gnu system shadow)
@@ -154,6 +157,9 @@
gnome-keyring-configuration?
gnome-keyring-service-type
+ seatd-configuration
+ seatd-service-type
+
%desktop-services))
;;; Commentary:
@@ -1182,6 +1188,58 @@ or setting its password with passwd.")))
(define polkit-wheel-service
(simple-service 'polkit-wheel polkit-service-type (list polkit-wheel)))
+
+;;;
+;;; seatd-service-type -- minimal seat management daemon
+;;;
+
+(define-record-type* <seatd-configuration> seatd-configuration
+ make-seatd-configuration
+ seatd-configuration?
+ (seatd seatd-package (default seatd))
+ (user seatd-user (default "root"))
+ (group seatd-group (default "users"))
+ (socket seatd-socket (default "/run/seatd.sock"))
+ (loglevel seatd-loglevel (default "error")))
+
+(define (seatd-shepherd-service config)
+ (list (shepherd-service
+ (documentation "Minimal seat management daemon")
+ (requirement '())
+ ;; TODO: once cgroups is separate dependency
+ ;; here we should depend on it rather than elogind
+ (provision '(seatd elogind))
+ (start #~(make-forkexec-constructor
+ (list #$(file-append (seatd-package config) "/bin/seatd")
+ "-u" #$(seatd-user config)
+ "-g" #$(seatd-group config)
+ "-s" #$(seatd-socket config))
+ #:environment-variables
+ (list (string-append "SEATD_LOGLEVEL="
+ #$(seatd-loglevel config)))
+ #:log-file "/tmp/seatd.log"))
+ (stop #~(make-kill-destructor)))))
+
+(define seatd-environment
+ (match-lambda
+ (($ <seatd-configuration> _ _ _ socket)
+ `(("SEATD_SOCK" . ,socket)))))
+
+(define seatd-service-type
+ (service-type
+ (name 'seatd)
+ (description "Seat management takes care of mediating access
+to shared devices (graphics, input), without requiring the
+applications needing access to be root.")
+ (extensions
+ (list
+ (service-extension session-environment-service-type seatd-environment)
+ ;; TODO: once cgroups is separate dependency we should not mount it here
+ ;; for now it is mounted here, because elogind mounts it
+ (service-extension file-system-service-type (const %control-groups))
+ (service-extension shepherd-root-service-type seatd-shepherd-service)))
+ (default-value (seatd-configuration))))
+
;;;
;;; The default set of desktop services.
--
2.32.0
- [bug#49969] [PATCH v3 00/10] gnu: desktop: Add seatd-service-type and greetd-service-type, (continued)
- [bug#49969] [PATCH v3 00/10] gnu: desktop: Add seatd-service-type and greetd-service-type, muradm, 2021/08/12
- [bug#49969] [PATCH v4 00/10] gnu: desktop: Add seatd-service-type and greetd-service-type, muradm, 2021/08/19
- [bug#49969] [PATCH v4 01/10] gnu: crates-io: Add rust-enquote 1.0.3, muradm, 2021/08/19
- [bug#49969] [PATCH v4 04/10] gnu: admin: Add greetd-pam-mount, muradm, 2021/08/19
- [bug#49969] [PATCH v4 06/10] gnu: desktop: Add greetd-service-type, muradm, 2021/08/19
- [bug#49969] [PATCH v4 02/10] gnu: crates-io: Add rust-pam-sys 0.5.6, muradm, 2021/08/19
- [bug#49969] [PATCH v4 03/10] gnu: freedesktop: Add greetd 0.7.0, muradm, 2021/08/19
- [bug#49969] [PATCH v4 07/10] gnu: base: Add greetd to applied PAM services, muradm, 2021/08/19
- [bug#49969] [PATCH v4 08/10] gnu: pam-mount: Add greetd to applied PAM services, muradm, 2021/08/19
- [bug#49969] [PATCH v4 10/10] doc: Add desktop seatd-service-type and greetd-service-type, muradm, 2021/08/19
- [bug#49969] [PATCH v4 05/10] gnu: desktop: Add seatd-service-type,
muradm <=
- [bug#49969] [PATCH v4 09/10] gnu: tests: Add seatd/greetd based minimal desktop system tests, muradm, 2021/08/19
- [bug#49969] [PATCH v5 00/10] gnu: desktop: Add seatd-service-type and greetd-service-type, muradm, 2021/08/22
- [bug#49969] [PATCH v5 02/10] gnu: crates-io: Add rust-pam-sys 0.5.6, muradm, 2021/08/22
- [bug#49969] [PATCH v5 04/10] gnu: admin: Add greetd-pam-mount, muradm, 2021/08/22
- [bug#49969] [PATCH v5 05/10] gnu: desktop: Add seatd-service-type, muradm, 2021/08/22
- [bug#49969] [PATCH v5 01/10] gnu: crates-io: Add rust-enquote 1.0.3, muradm, 2021/08/22
- [bug#49969] [PATCH v5 03/10] gnu: freedesktop: Add greetd 0.7.0, muradm, 2021/08/22
- [bug#49969] [PATCH v5 06/10] gnu: desktop: Add greetd-service-type, muradm, 2021/08/22
- [bug#49969] [PATCH v5 08/10] gnu: pam-mount: Add greetd to applied PAM services, muradm, 2021/08/22
- [bug#49969] [PATCH v5 09/10] gnu: tests: Add seatd/greetd based minimal desktop system tests, muradm, 2021/08/22