From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 6L21MCNuHmEj7gAAgWs5BA (envelope-from ) for ; Thu, 19 Aug 2021 16:43:47 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id mChyLCNuHmFVLgAAB5/wlQ (envelope-from ) for ; Thu, 19 Aug 2021 14:43:47 +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 C1C851F8F6 for ; Thu, 19 Aug 2021 16:43:44 +0200 (CEST) Received: from localhost ([::1]:60652 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mGjGh-0005qE-SZ for larch@yhetil.org; Thu, 19 Aug 2021 10:43:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59248) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mGjD9-0006YY-MA for guix-patches@gnu.org; Thu, 19 Aug 2021 10:40:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:49027) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mGjD9-0005vG-BK for guix-patches@gnu.org; Thu, 19 Aug 2021 10:40:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mGjD9-0000L8-9F for guix-patches@gnu.org; Thu, 19 Aug 2021 10:40:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49969] [PATCH v4 05/10] gnu: desktop: Add seatd-service-type Resent-From: muradm Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 19 Aug 2021 14:40: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.16293839731204 (code B ref 49969); Thu, 19 Aug 2021 14:40:03 +0000 Received: (at 49969) by debbugs.gnu.org; 19 Aug 2021 14:39:33 +0000 Received: from localhost ([127.0.0.1]:60559 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mGjCf-0000JH-Dc for submit@debbugs.gnu.org; Thu, 19 Aug 2021 10:39:33 -0400 Received: from mail-ej1-f43.google.com ([209.85.218.43]:44996) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mGjCY-0000Hl-02 for 49969@debbugs.gnu.org; Thu, 19 Aug 2021 10:39:26 -0400 Received: by mail-ej1-f43.google.com with SMTP id bq25so13357648ejb.11 for <49969@debbugs.gnu.org>; Thu, 19 Aug 2021 07:39:25 -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=Sp33gQQBygwHj8x5D/cTuv92CAb24beXS7SlNnF62pw=; b=ssjtWBXema9F85APczYWbMKB+vqQJ27sCR97x7jNzzyJORr2fdY85OiNL0eGMOzW82 ucSCsaHWES20DXH+wmehtEM2XeOLr9jxzYkQaZHkgJRDPNUToeFPbAHwkjX9H+uIiebM JHFTvIE6pSu85BeUrXquS91SV70pKJedsWP3ZrQsw/dIMqjg0UIaieWqXwVAFMC4i1YR dZ5n0xL+E46o6I96h2+S0R7nXYggjSwyF/EDt6zjMnw6rbFm+aTD7FB2JcsKh+jQDdN8 uA9PqtnrmpvzlpO50kh9gvkhzl3kAXqDFtCZP/OQMibcRG08VeMtdLuIWgxQmwK/Znh3 6UVw== 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=Sp33gQQBygwHj8x5D/cTuv92CAb24beXS7SlNnF62pw=; b=uKcLm2qHLehNsCZbCqj9MZiZVe1CCqDoBtaIZg4mZS1F1DCA6zaEhqZ4OGtjoM8dsW 4zLwKSnni93JgxNF7sIJeqhhnEzmykhZapBlb0Mo0f5D0PqniM+8Kn96ZMK4K5Dbpiiu SNwhc4OoVgsBFyLoxxnjLG2CY1WuzFSMbYB9usQQrba+t5XgROpFKwgLlAL3YO7UGakZ w+z+mJXbE9EXrwJ1ec/Ubw15gPE9omD0PidugZz9qTcSnoaW0Al1lfqVLCNp+zZjCqQz 9uVk0y4/p0t9l/NP72Ry4ym608sH9uU8Bemhlwa0peSzwEkjIgixPTnClNcWcq7yCHQc IUhA== X-Gm-Message-State: AOAM530CCOAI+40h4IL9XkSQQtYhROOGQ99EePjBjkJFa5wtIT+6fd2+ u33yKnbX2k1KOQ+/vTOrXDUOvxpbEDzXyg== X-Google-Smtp-Source: ABdhPJw25GjxKMYASOKOXEfD2I14km14dLTe70AnVP+WphniW5/deLkpIAxyEc5zNE9qUCifzpbrHQ== X-Received: by 2002:a17:906:aac7:: with SMTP id kt7mr16111107ejb.4.1629383959885; Thu, 19 Aug 2021 07:39:19 -0700 (PDT) Received: from localhost.localdomain ([188.58.13.35]) by smtp.gmail.com with ESMTPSA id b8sm1825954edv.96.2021.08.19.07.39.18 for <49969@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Aug 2021 07:39:19 -0700 (PDT) From: muradm Date: Thu, 19 Aug 2021 17:39:01 +0300 Message-Id: <20210819143906.6705-5-mail@muradm.net> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210819143133.6398-1-mail@muradm.net> References: <20210819143133.6398-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=1629384224; 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=2tztAbW2iiK3WAitnKUxf3NHMCKgWI2f0TDONEsDf78=; b=dvCQFwfIBfdLiUHbC7Kwi7a11J99VOK3Uu7bEcOBQl/WxRs0owmQKW9YAQQuGn+L8JGcPo eV+qz+oFxplCXRpmnIcBI3bkoPomiIDtlgE3B54OZPMaLzDif8FzU4Nqk9hEwwWTPDetnv lYqd/m2NvILsQFW/alLwO6RiE/9BmI+9H8whocEewtQFNDIasBrEpoZEfU9kKcrKuNhHz2 lXoF8Ry3zLaVbaYW9B1CdAmA9yMQhZSMweAmlogzIZjbKGl2/ZBcHYwLstKqAHwrQWlMPD AFQyfNZpUi1s23y0EdyFluahNsY5tr8D/TAYhtvgRdr6OKO5xZHhD1z/E+A8RQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1629384224; a=rsa-sha256; cv=none; b=ERleV2TKLW6zv8Wmx7beB7I+Sq3mNNkU+cCxWiAqCa7wGlKwuofz0g86dmoYt9k5l12Kxb t0bFxaVZoY1us9BAaZqq9RqIhZz2Hh2O3cW92Q+uI58CaUjkgBCyugGWgrHwXmIb4IiuXf jykRxkytQ389uGDijejWCSmYKiRW26/qEhbmnVQ/3XgHc3SsgutH9cb5Fn3sh7H4ztYNpJ oxBwRxl0kAyNpaQMJ/jWWQLB1paBbKzS+dMMFzxT25nmeT7l2HxWyB4279ttiZMxlBJ7jr 9izk5c7bWzzmmLEP8cLAm3h8nNqGL5t+RJhQ1cKa7YkNZK+UKy73ijI6Ooq9nQ== 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=ssjtWBXe; 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.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=ssjtWBXe; 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: C1C851F8F6 X-Spam-Score: -0.42 X-Migadu-Scanner: scn0.migadu.com X-TUID: ZPnGcrA0gleF * 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 ;;; 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.32.0