From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id YL/AOKHomWKKBwEAbAwnHQ (envelope-from ) for ; Fri, 03 Jun 2022 12:55:29 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id mCG9OKHomWIu2wAA9RJhRA (envelope-from ) for ; Fri, 03 Jun 2022 12:55:29 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id D80E93C505 for ; Fri, 3 Jun 2022 12:55:24 +0200 (CEST) Received: from localhost ([::1]:38688 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nx4xf-0004Da-B1 for larch@yhetil.org; Fri, 03 Jun 2022 06:55:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33096) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nx4uT-0001au-88 for guix-patches@gnu.org; Fri, 03 Jun 2022 06:52:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:33252) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nx4uR-0006x2-Sy for guix-patches@gnu.org; Fri, 03 Jun 2022 06:52:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nx4uR-0002z2-S8 for guix-patches@gnu.org; Fri, 03 Jun 2022 06:52:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49969] [PATCH v9 6/7] gnu: desktop: Add seatd-service-type. Resent-From: Hilton Chain Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 03 Jun 2022 10:52:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49969 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49969@debbugs.gnu.org Received: via spool by 49969-submit@debbugs.gnu.org id=B49969.165425349911404 (code B ref 49969); Fri, 03 Jun 2022 10:52:03 +0000 Received: (at 49969) by debbugs.gnu.org; 3 Jun 2022 10:51:39 +0000 Received: from localhost ([127.0.0.1]:55376 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nx4u3-0002xm-6S for submit@debbugs.gnu.org; Fri, 03 Jun 2022 06:51:39 -0400 Received: from [192.151.158.155] (port=48930 helo=mail.boiledscript.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nx4NN-0001uJ-M3 for 49969@debbugs.gnu.org; Fri, 03 Jun 2022 06:17:55 -0400 Received: from localhost (unknown [192.168.203.1]) by mail.boiledscript.com (Postfix) with ESMTP id 4F384300A0B for <49969@debbugs.gnu.org>; Fri, 3 Jun 2022 10:17:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ultrarare.space; s=dkim; t=1654251468; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PRSXOce/KWZjd7RImPKoiHLofiTC6TX4PcTfHRvZGl8=; b=pxH6xgEQ1PlT2LF7pgkoLu5k7WQdjTUYQ3isDZV7Nirbaxq/UpCgaDjiY6bbryg/TFlfhg nX7JzNXgN0Jp055jQK8/mLxezGXPV5C16h4+hjmrcFClgnjcGZq0jgJzRCm5MZw0hq5Mta rK+o0YfU4CFORbPU5oBnaFY5zxrWdD2b96KJC08GaiFnj3+vOq9sAAzGWgNZvQkDkCP96l Woy4x47UCSI1OufaTPGGXovOFZU72yJJRLcNJqLxw4MudbNmESBeROUFjy1kUXtvcMbiaw mtVQFaH/Kkrd4d785d7DFV9EFrqbdNrl4pJIPlMJrsuufBqmOqAbBFxc/qSO/w== Date: Fri, 3 Jun 2022 18:17:35 +0800 Message-ID: <20220603181735.4ceb2425@ultrarare.space> In-Reply-To: <20220603181644.4dd65bf3@ultrarare.space> References: <20220603180923.0caf6958@ultrarare.space> <20220603181031.1ac07de0@ultrarare.space> <20220603181143.5bef4199@ultrarare.space> <20220603181411.0a9ec225@ultrarare.space> <20220603181541.26a4c4f5@ultrarare.space> <20220603181644.4dd65bf3@ultrarare.space> X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: / X-Mailman-Approved-At: Fri, 03 Jun 2022 06:51:29 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Mailman-Approved-At: Fri, 03 Jun 2022 06:54:55 -0400 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" Reply-to: Hilton Chain X-ACL-Warn: , Hilton Chain via Guix-patches From: Hilton Chain via Guix-patches via X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1654253725; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=PRSXOce/KWZjd7RImPKoiHLofiTC6TX4PcTfHRvZGl8=; b=rqSUmr4wA91VHbQdTy/fOc4HEqBLpOkefnYvIoLSshnV2ro/1uE2vdVzquRPxZO7xeVOcP rSA524NlNkjOPWbS9QzAzJIuJyaL2eFCHE7WmOCDq37AEpdVQA8Y1PSZzU66cVAxiSKrFv L4zaIIZliHCIN+ii+TAgiw7HRYAPU374OTPI3Hh2pPmBiuhpGmvfzfdepp+gd4kcMGBUTb ipEVe7h6RATx2hEdOi2VV46Qu1pc3KYoJw3oe0j3YBUKKUTWecaffhjlAoT3Xe56YHX/xo DXalApHUbPcDgWFB5MaqEEic3mxIOC6xO1FUEmh29mF0XsrNyyAlTcQZvdK1RA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1654253725; a=rsa-sha256; cv=none; b=i8PyXIgyN1Nmlb0ZVtdl3uXLP2Z9+1ZmKMFW8LbaK7LFP1zX1w9FkjpWXGA+LgWxjZr9UH rdInq+uYlIJO96wHp2VgDpq2/QRj9jn6BX14PvVL9WlJ4jaFShAhzOt576hD7ZNX3kTDKD d64emTX0zuLfgQhGFlE/bjwcJ7aHmNiN1mLdEarLcx5Rc1QhB5aiKhgqHzcBetsOGD23LE ND5fX7fBG0c7XGYCEb9DlcEvwlWsV2R2vNF1aRqrTRplQbOfbn2CIgl546on6EveyeJALQ +w9F1oVklFgvSu5Rn5Xl2KyYiJCduLI4d7ViE+/YaYoZHBX600EGdrxOtm1Fxw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=ultrarare.space header.s=dkim header.b=pxH6xgEQ; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.82 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=ultrarare.space header.s=dkim header.b=pxH6xgEQ; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: D80E93C505 X-Spam-Score: -3.82 X-Migadu-Scanner: scn0.migadu.com X-TUID: IcrWg2CBLw/l * gnu/services/desktop.scm (seatd-service-type): New variable * gnu/services/desktop.scm (seatd-configuration): New data type Signed-off-by: Hilton Chain --- doc/guix.texi | 42 ++++++++++++++++++++++++++++ gnu/services/desktop.scm | 59 +++++++++++++++++++++++++++++++++++++++- 2 files changed, 100 insertions(+), 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index 825c7d93c577..3f8e61a2b16e 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -22656,6 +22656,48 @@ Desktop Services @end table @end deftp =20 +@defvr {Scheme Variable} seatd-service-type +@uref{https://sr.ht/~kennylevinsen/seatd/, seatd} is a minimal seat +management daemon. + +Seat management takes care of mediating access to shared devices (graphics, +input), without requiring the applications needing access to be root. + +@lisp +(append + (list + ;; make sure seatd is running + (service seatd-service-type)) + + ;; normally one would want %base-services + %base-services) + +@end lisp +@end defvr + +@deftp {Data Type} seatd-configuration +Configuration record for the seatd daemon service. + +@table @asis +@item @code{seatd} (default: @code{seatd}) +The seatd package to use. + +@item @code{user} (default: @samp{"root"}) +User to own the seatd socket. + +@item @code{group} (default: @samp{"users"}) +Group to own the seatd socket. + +@item @code{socket} (default: @samp{"/run/seatd.sock"}) +Where to create the seatd socket. + +@item @code{loglevel} (default: @samp{"error"}) +Log level to output logs. Possible values: @samp{"silent"}, @samp{"error"}, +@samp{"info"} and @samp{"debug"}. + +@end table +@end deftp + @node Sound Services @subsection Sound Services =20 diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm index 0499071436af..1ba91002e444 100644 --- a/gnu/services/desktop.scm +++ b/gnu/services/desktop.scm @@ -13,6 +13,7 @@ ;;; Copyright =C2=A9 2020 Tobias Geerinckx-Rice ;;; Copyright =C2=A9 2020 Reza Alizadeh Majd ;;; Copyright =C2=A9 2021 Brice Waegeneire +;;; Copyright =C2=A9 2021 muradm ;;; ;;; This file is part of GNU Guix. ;;; @@ -39,7 +40,9 @@ (define-module (gnu services desktop) #: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)) #:autoload (gnu services sddm) (sddm-service-type) #:use-module (gnu system) #:use-module (gnu system setuid) @@ -157,6 +160,9 @@ (define-module (gnu services desktop) gnome-keyring-configuration? gnome-keyring-service-type =20 + seatd-configuration + seatd-service-type + %desktop-services)) =20 ;;; Commentary: @@ -1630,6 +1636,57 @@ (define polkit-wheel (define polkit-wheel-service (simple-service 'polkit-wheel polkit-service-type (list polkit-wheel))) =20 +=0C +;;; +;;; seatd-service-type -- minimal seat management daemon +;;; + +(define-record-type* 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)) + #:environment-variables + (list (string-append "SEATD_LOGLEVEL=3D" + #$(seatd-loglevel config))) + #:log-file "/tmp/seatd.log")) + (stop #~(make-kill-destructor))))) + +(define seatd-environment + (match-lambda + (($ _ _ _ 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 h= ere + ;; 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)))) + =0C ;;; ;;; The default set of desktop services. --=20 2.36.1