From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id +KbeHZczNmFCiwAAgWs5BA (envelope-from ) for ; Mon, 06 Sep 2021 17:28:23 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id mG9wGZczNmGcewAAB5/wlQ (envelope-from ) for ; Mon, 06 Sep 2021 15:28:23 +0000 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 C5E01115AF for ; Mon, 6 Sep 2021 17:28:22 +0200 (CEST) Received: from localhost ([::1]:48036 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mNGXl-0001WX-Qe for larch@yhetil.org; Mon, 06 Sep 2021 11:28:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58960) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mNGXT-0000zX-W9 for guix-patches@gnu.org; Mon, 06 Sep 2021 11:28:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:42703) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mNGXT-00070t-NR for guix-patches@gnu.org; Mon, 06 Sep 2021 11:28:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mNGXT-0006oE-K1 for guix-patches@gnu.org; Mon, 06 Sep 2021 11:28:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49969] [PATCH v6 7/8] gnu: desktop: Add seatd-service-type. Resent-From: muradm Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 06 Sep 2021 15:28: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.163094203626081 (code B ref 49969); Mon, 06 Sep 2021 15:28:03 +0000 Received: (at 49969) by debbugs.gnu.org; 6 Sep 2021 15:27:16 +0000 Received: from localhost ([127.0.0.1]:54243 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNGWc-0006mP-Jc for submit@debbugs.gnu.org; Mon, 06 Sep 2021 11:27:16 -0400 Received: from mail-wr1-f50.google.com ([209.85.221.50]:33339) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNGWT-0006kH-Bi for 49969@debbugs.gnu.org; Mon, 06 Sep 2021 11:27:08 -0400 Received: by mail-wr1-f50.google.com with SMTP id b10so10436988wru.0 for <49969@debbugs.gnu.org>; Mon, 06 Sep 2021 08:27:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=muradm-net.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=uzURvM08dygKJRZZBFmShSsZeHbL0S+O53XjqwFiNqk=; b=Q4x6YuGX283dtELvy1tQg1C86ChWWRxZdvYIwofy+9ptxQ+G2liJgJ3lq+gLA0aII8 GqKpmzkvRmDGO0Ko2D0bel6q274fnk+lGMAavjyUWs8WvENtmaYGlGyIDfm4su6GqG1M poAX7nrBAXjYlaT6KbWgpuzYf+62YNUlquLtkUgbP1wBtoLbwWDmYJTzxRhSsnuj8xO8 KjJsJigWTE+KW3sMyiO2SgJKoc4WnvzseocdcbiRJHnsGy9NdWf9MxoY1dUPaCkVfzGT xZfp1JFlTLQEqPMz8wJ4h4ODMwxehGxAv9pKWk1nsxCqf6DT7kPAcCX91cKnACxfLT9y H90g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uzURvM08dygKJRZZBFmShSsZeHbL0S+O53XjqwFiNqk=; b=OKE0jN4Z2l21QIClLEIedfJjVqwF8zHhL3pvWajAlqCO1/0+8UjMWRS+P9e/67zMFi u3xxE1KlCCtbvQgzRl152JHqR8Ak9MkyZOppFfSQ+l4LzeUPN8jL1YP7HuZ9d2CD49A9 883hagme1IzLvRi9n4LvtRjZ1Wq1fH3IsgdGwS5pHg34N2kvNzwTDXrd3uGINCy+RNz6 uJAimRRY1XrF/R2KVaDqK9vhKlbnH7hT7x4RdFyoRqpNKwIAg1UdnGtpmcxTwmRM+45I 15wSm03Maujm1fzQue5Y0DjIBRZP3kBS2dVsdPsQFb+6bPsaXZzCB1LStvwAA23DHQoM ScbQ== X-Gm-Message-State: AOAM5324pmObB5KPo1Jjmxsn+05LJiJLUhVB7/NqpS8V5BiVmqWv+QNB ftPd1DYyL8GuX/AoILgFdZ4YYq5raByPhS9R X-Google-Smtp-Source: ABdhPJwTGfQw9vcNNacapLoLdq8MY+z0xWAo7H74OmlUIgld2d+5x8INPABBiZfHFjb2+lqKsP2eVw== X-Received: by 2002:adf:9f0d:: with SMTP id l13mr14187514wrf.328.1630942015333; Mon, 06 Sep 2021 08:26:55 -0700 (PDT) Received: from localhost.localdomain ([176.234.10.27]) by smtp.gmail.com with ESMTPSA id m4sm7687896wml.28.2021.09.06.08.26.54 for <49969@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Sep 2021 08:26:54 -0700 (PDT) From: muradm Date: Mon, 6 Sep 2021 18:26:40 +0300 Message-Id: <20210906152641.11020-8-mail@muradm.net> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210906152641.11020-1-mail@muradm.net> References: <20210822215048.20480-1-mail@muradm.net> <20210906152641.11020-1-mail@muradm.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1630942103; h=from:from:sender:sender: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=kAj1UmM/4vooo6BKDU3U8vA7um5MjQKjXZT2joqVhxk=; b=A4KtYgQHHlwhbEtYHvjoLKZpqnquk1GrGACEIzIo1TeagHzLjWhXU0dQ4+WukNp1dqblPL ZNXa4wmnCSex2p6TJp9sy/30x4zttZ8VXa9p/x7NFMz0lX5QNm0fiZkGeLPPmeDPYOZXpw PhT4DiyU8V4Wta8lCYVjt0W31sfL0+2OZkazEafso+skyJeFjzwVCRP1Rxcpal0BOo5xQV eOS4KeyBe9lyvmAvL5I6VGpYraTky2MeqgjLYf0Dn7KuIxxmEVY8RvZJvVb+3DZvNxHBg/ dhdpEHdOrvVP1iHn4BwX03M4EbPwVM3/4uqLEC4+OQuuDvandgfRozsX4981DA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1630942103; a=rsa-sha256; cv=none; b=PnktOyvBJX5MUBGULKxNNpFdC5PsXm+lTQzTnrh9nUqRnIJJ+/JANmfJLGcnR5AnNCrdJn AKMYM3OVhmwdBJEzunKzpC+dkw7bBNsyqYyDheiSMdSLWoTCFlBbkG8x2T3ZBZsd3yh/kd L2gLwedwQjN+y3YSI9gfuAFmUjvM8HyNgwCR00k/4g179Bd73S6p0kMCwotFMgKA04guf5 tpI4bNlEvsVubIO3++3/ChlV+SsuJTGaAJl2KbagsmDhD806ml9fgLPJfkvGKxLLr9xPbl nT/4Aa5Ux+ZDqIcsybASY7B0/9uMoWzgw+bgfI6/2R4oanAdD76JUc3wAHmp4g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=muradm-net.20150623.gappssmtp.com header.s=20150623 header.b=Q4x6YuGX; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -0.42 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=muradm-net.20150623.gappssmtp.com header.s=20150623 header.b=Q4x6YuGX; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: C5E01115AF X-Spam-Score: -0.42 X-Migadu-Scanner: scn0.migadu.com X-TUID: rmPLyPBPSTDi * gnu/services/desktop.scm (seatd-service-type): New variable --- doc/guix.texi | 42 ++++++++++++++++++++++++++++ gnu/services/desktop.scm | 60 +++++++++++++++++++++++++++++++++++++++- 2 files changed, 101 insertions(+), 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index 79bf291ec4..9c40342f9f 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -19901,6 +19901,48 @@ and ``passwd'' is with the value @code{passwd}. @end table @end deftp +@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 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 ;;; Copyright © 2020 Reza Alizadeh Majd ;;; Copyright © 2021 Brice Waegeneire +;;; Copyright © 2021 muradm ;;; ;;; 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 + 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 + (($ _ _ _ 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.33.0