From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id qAGXKDabFWHVLgAAgWs5BA (envelope-from ) for ; Fri, 13 Aug 2021 00:05:42 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id aATZIzabFWECZQAAbx9fmQ (envelope-from ) for ; Thu, 12 Aug 2021 22:05:42 +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 0459F10DCA for ; Fri, 13 Aug 2021 00:05:42 +0200 (CEST) Received: from localhost ([::1]:44108 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mEIpY-0001bY-Va for larch@yhetil.org; Thu, 12 Aug 2021 18:05:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35554) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mEIoz-0000UC-Bk for guix-patches@gnu.org; Thu, 12 Aug 2021 18:05:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:56748) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mEIoz-00068v-30 for guix-patches@gnu.org; Thu, 12 Aug 2021 18:05:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mEIoy-0002wL-Sm for guix-patches@gnu.org; Thu, 12 Aug 2021 18:05:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49969] [PATCH v3 05/10] gnu: desktop: Add seatd-service-type Resent-From: muradm Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 12 Aug 2021 22:05:04 +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.162880588811148 (code B ref 49969); Thu, 12 Aug 2021 22:05:04 +0000 Received: (at 49969) by debbugs.gnu.org; 12 Aug 2021 22:04:48 +0000 Received: from localhost ([127.0.0.1]:40042 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mEIoi-0002te-07 for submit@debbugs.gnu.org; Thu, 12 Aug 2021 18:04:48 -0400 Received: from mail-ej1-f48.google.com ([209.85.218.48]:43914) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mEIof-0002tA-Hq for 49969@debbugs.gnu.org; Thu, 12 Aug 2021 18:04:46 -0400 Received: by mail-ej1-f48.google.com with SMTP id b15so14421973ejg.10 for <49969@debbugs.gnu.org>; Thu, 12 Aug 2021 15:04:45 -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=VBcyOm+hs1UvnMoo/bXfZIc2oTwGkhWXIaWrIjHUG/0=; b=vO5yqmRSOWcnyk6tjyTmlTwrTjECx9Q+OE/urwozjCh5peWCR8Qi8U9D/oakYDvna6 ivAT8rwstmzoSbkqFkO5jmNYiAphRMny944IOneg+y8SjOL/KCPdRJ4fMr6J46++Pl67 hxmUKxlDmZ/Y/kd27JfC1DSF5psVhpkkHmvQR6UvfGtuN1b9TMCt30zOu4IH+bIR/Dzg oUXfxbYXY57qp1ax1Z+P7ws/DmkUZhALOMoY8SnNy19iSzuv41MUUh2sdo7hLID8bx9G En9OcxHpb2716CXX/W+FRM5XHXbFHTSk37Je9ZoAbz1y7jcBagYVqQu4MvCwHmdWDhw+ VqDA== 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=VBcyOm+hs1UvnMoo/bXfZIc2oTwGkhWXIaWrIjHUG/0=; b=Avq2ZcSyKqYefUFFCkpWEg3BOHE2gGBO2SbEkIwpTp+hmUXtY/PDpVCDExvKkBfyYI erMQMmU8X8uygKfPYd0KNV3AIO5kUuzhheHCquQrC0l7MKI2joTNEvWRWChaShWRGxpX HS6UFFU4CW/sx984m76rCcwaSIM/arpq84UnVGZbcyuqh8T0NfKzIEUBR4/loYTjt55o mWo8dahhnMQp/BSCFPxcGv0rs257X36vDD5f6WBXyScsQ2WF8FjnZm4TXA4qurrzG5xA EFL2iLZ4FQXzzWnzWE1Kc1W9Ck6kzdb9kuArAfUAgghDk74vtjiHaxC896Jkds3yV+gB anXA== X-Gm-Message-State: AOAM531P6aWuwcYBdkKAvTR9VAVE3YRkNFvffvml120mZAo1YvE0E+em Vl9OJ5NvqQOMcB3gsT/uD9zJ+xwGSeStPQ== X-Google-Smtp-Source: ABdhPJylIDtaRjwsrY0LQiLmlxEnIqzuBQVp3sXGDBWN0CiSA5l3H1qAesCyZEyLKYLdUQtah3A//w== X-Received: by 2002:a17:906:d7af:: with SMTP id pk15mr5724446ejb.51.1628805874311; Thu, 12 Aug 2021 15:04:34 -0700 (PDT) Received: from localhost.localdomain ([5.24.104.153]) by smtp.gmail.com with ESMTPSA id o23sm1750302eds.75.2021.08.12.15.04.33 for <49969@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Aug 2021 15:04:33 -0700 (PDT) From: muradm Date: Fri, 13 Aug 2021 01:04:15 +0300 Message-Id: <20210812220420.24118-6-mail@muradm.net> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210812220022.24025-1-mail@muradm.net> References: <20210812220022.24025-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=1628805942; 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=5pAFK0DOwhUOn/se/xXpwZFSqx9fVFxWgMCWdYUDFm0=; b=aiGWCnOsO+SotwogcxXNpaxzud8B/gNx1JuYiodiHN7jI8ImWbtX+GVQEnGSTSJj2R96Xx ghQw/QRjjV2ATv1fz2wUg9m423eB/jefTzS49Zv8Cj396nn8Wji4o4d+Hlpcl4mOLmNZbY CDRVRwgP3aw9/AlaO43j6liqTjH5uhAnB9ZDE6yYYzzp1rBmQCyLVhDHGW+Y6fsYIdF7wW szP/hlwJ9agElcehckraVcBmpDJluPVPvYr6L3ojwAkH8EYBFXUSjWfLQ6/M/Y+/vIQMMF 15mZaxwNT9NLSJH7UVRvP5CiCQxKU2leZte4bNFZZXcSxVVsJ/U+lugKM04utQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1628805942; a=rsa-sha256; cv=none; b=mDIU8Ju237Ped9OtK9/Wag22ZYl5/Fgt2Y7PCsL/HUK8OYPjlz2OXs7EjbaSVB2nW1Is4J 2e6IfOI1MNog/euBd/4NXxepNBHuGADPuv0jJy3BVM/+RGkgV/bIDLhhteBXd96Y7Z6n3V jAlRjdhNouYufKRO1XdOEDOnyvFvyYnZdCe0E9WzmeI98DEQTqzcz81dpknu0UJfISItu/ 6QBzSDUyecaIjVMfxKNAE8mAvVd6isn2KNEqMZ/1Tk4CzZtc2/i9+IkGFRLrrX97kvNs2e udvE/oA0w7ZAepreVJeVoHPqAcJaN05MoFyLyVHqsXMwVvHQxHO5Zd1pJ8gF8Q== 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=vO5yqmRS; 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-Spam-Score: -0.41 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=muradm-net.20150623.gappssmtp.com header.s=20150623 header.b=vO5yqmRS; 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: 0459F10DCA X-Spam-Score: -0.41 X-Migadu-Scanner: scn1.migadu.com X-TUID: or4mHRmwjW4g * 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..a63a2936a7 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 + (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