summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authormuradm <mail@muradm.net>2022-06-15 12:17:41 +0300
committerLars-Dominik Braun <ldb@leibniz-psychology.org>2022-06-17 10:30:43 +0200
commitd6dda325c10a4aa8605fefa3906066ce792c2e81 (patch)
tree0757fe3bce9616f1501639bc63f2952d0a3fb221 /gnu
parent167b8f29b3679a23bb20f5ed4181738c389d9d89 (diff)
gnu: desktop: Add seatd-service-type.
* gnu/services/desktop.scm (seatd-service-type): New variable * gnu/services/desktop.scm (seatd-configuration): New data type Signed-off-by: Lars-Dominik Braun <ldb@leibniz-psychology.org>
Diffstat (limited to 'gnu')
-rw-r--r--gnu/services/desktop.scm62
1 files changed, 61 insertions, 1 deletions
diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm
index 0499071436a..29a3722f1b5 100644
--- a/gnu/services/desktop.scm
+++ b/gnu/services/desktop.scm
@@ -13,6 +13,7 @@
13;;; Copyright © 2020 Tobias Geerinckx-Rice <me@tobias.gr> 13;;; Copyright © 2020 Tobias Geerinckx-Rice <me@tobias.gr>
14;;; Copyright © 2020 Reza Alizadeh Majd <r.majd@pantherx.org> 14;;; Copyright © 2020 Reza Alizadeh Majd <r.majd@pantherx.org>
15;;; Copyright © 2021 Brice Waegeneire <brice@waegenei.re> 15;;; Copyright © 2021 Brice Waegeneire <brice@waegenei.re>
16;;; Copyright © 2021 muradm <mail@muradm.net>
16;;; 17;;;
17;;; This file is part of GNU Guix. 18;;; This file is part of GNU Guix.
18;;; 19;;;
@@ -39,7 +40,9 @@
39 #:use-module (gnu services networking) 40 #:use-module (gnu services networking)
40 #:use-module (gnu services sound) 41 #:use-module (gnu services sound)
41 #:use-module ((gnu system file-systems) 42 #:use-module ((gnu system file-systems)
42 #:select (%elogind-file-systems file-system)) 43 #:select (%control-groups
44 %elogind-file-systems
45 file-system))
43 #:autoload (gnu services sddm) (sddm-service-type) 46 #:autoload (gnu services sddm) (sddm-service-type)
44 #:use-module (gnu system) 47 #:use-module (gnu system)
45 #:use-module (gnu system setuid) 48 #:use-module (gnu system setuid)
@@ -157,6 +160,9 @@
157 gnome-keyring-configuration? 160 gnome-keyring-configuration?
158 gnome-keyring-service-type 161 gnome-keyring-service-type
159 162
163 seatd-configuration
164 seatd-service-type
165
160 %desktop-services)) 166 %desktop-services))
161 167
162;;; Commentary: 168;;; Commentary:
@@ -1632,6 +1638,60 @@ or setting its password with passwd.")))
1632 1638
1633 1639
1634;;; 1640;;;
1641;;; seatd-service-type -- minimal seat management daemon
1642;;;
1643
1644(define-record-type* <seatd-configuration> seatd-configuration
1645 make-seatd-configuration
1646 seatd-configuration?
1647 (seatd seatd-package (default seatd))
1648 (user seatd-user (default "root"))
1649 (group seatd-group (default "users"))
1650 (socket seatd-socket (default "/run/seatd.sock"))
1651 (logfile seatd-logfile (default "/var/log/seatd.log"))
1652 (loglevel seatd-loglevel (default "info")))
1653
1654(define (seatd-shepherd-service config)
1655 (list (shepherd-service
1656 (documentation "Minimal seat management daemon")
1657 (requirement '())
1658 ;; TODO: once cgroups is separate dependency
1659 ;; here we should depend on it rather than elogind
1660 (provision '(seatd elogind))
1661 (start #~(make-forkexec-constructor
1662 (list #$(file-append (seatd-package config) "/bin/seatd")
1663 "-u" #$(seatd-user config)
1664 "-g" #$(seatd-group config))
1665 #:environment-variables
1666 (list (string-append "SEATD_LOGLEVEL="
1667 #$(seatd-loglevel config))
1668 (string-append "SEATD_DEFAULTPATH="
1669 #$(seatd-socket config)))
1670 #:log-file #$(seatd-logfile config)))
1671 (stop #~(make-kill-destructor)))))
1672
1673(define seatd-environment
1674 (match-lambda
1675 (($ <seatd-configuration> _ _ _ socket)
1676 `(("SEATD_SOCK" . ,socket)))))
1677
1678(define seatd-service-type
1679 (service-type
1680 (name 'seatd)
1681 (description "Seat management takes care of mediating access
1682to shared devices (graphics, input), without requiring the
1683applications needing access to be root.")
1684 (extensions
1685 (list
1686 (service-extension session-environment-service-type seatd-environment)
1687 ;; TODO: once cgroups is separate dependency we should not mount it here
1688 ;; for now it is mounted here, because elogind mounts it
1689 (service-extension file-system-service-type (const %control-groups))
1690 (service-extension shepherd-root-service-type seatd-shepherd-service)))
1691 (default-value (seatd-configuration))))
1692
1693
1694;;;
1635;;; The default set of desktop services. 1695;;; The default set of desktop services.
1636;;; 1696;;;
1637 1697