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 aLj9GDdOp2KYDgEAbAwnHQ (envelope-from ) for ; Mon, 13 Jun 2022 16:48:23 +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 AGMVGTdOp2LpYwEA9RJhRA (envelope-from ) for ; Mon, 13 Jun 2022 16:48:23 +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 D4E991E1DF for ; Mon, 13 Jun 2022 16:48:22 +0200 (CEST) Received: from localhost ([::1]:48876 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o0lMb-0002Tf-UI for larch@yhetil.org; Mon, 13 Jun 2022 10:48:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52028) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o0lLN-000123-Cw for guix-patches@gnu.org; Mon, 13 Jun 2022 10:47:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:37965) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o0lLM-0001aB-1M for guix-patches@gnu.org; Mon, 13 Jun 2022 10:47:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o0lLM-0006wy-0G for guix-patches@gnu.org; Mon, 13 Jun 2022 10:47:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49969] [PATCH v11 7/8] gnu: desktop: Add seatd-service-type. Resent-From: muradm Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 13 Jun 2022 14:47: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.165513159925613 (code B ref 49969); Mon, 13 Jun 2022 14:47:03 +0000 Received: (at 49969) by debbugs.gnu.org; 13 Jun 2022 14:46:39 +0000 Received: from localhost ([127.0.0.1]:60088 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o0lKj-0006Sl-QK for submit@debbugs.gnu.org; Mon, 13 Jun 2022 10:46:39 -0400 Received: from nomad-cl1.staging.muradm.net ([139.162.159.157]:43542 helo=nomad-cl1.muradm.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o0lKG-000643-Dt for 49969@debbugs.gnu.org; Mon, 13 Jun 2022 10:45:57 -0400 Received: from localhost ([127.0.0.1]:35064) by nomad-cl1.muradm.net with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1o0lI7-0003jW-4i for 49969@debbugs.gnu.org; Mon, 13 Jun 2022 14:43:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=muradm.net; s=mail; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=9OKNnQJMWqLxmJgn9iWyU3TM14PZmrTLw/2VCc0jci0=; b=mJYBgS2Hg8mBy/7EqNoz+p12e4 Z8+PwQgxiI2mSVHfmSPk+MzVwlLoUXHmcVGOOj3lrNNMx3K46cBZnOUvXvhcGfAUw++2TPBN4RQyG SrPIwKLKBfZ6kz46aoMzcrAmmHXoGcHQIrZP8ACgl5JAb+lA7+NrE4auZcZQmm2806FwpsSGl5DiH vWRM3wdqj5GQI1mZAiwaApLUhKCtMhvhgXSE9x9ieHGjxhmjC6BkW74GomJGiIg73y1NyxISrp7xb NEJTlVVNPWpFuzXGutZQoVuavbZkpMjdgZshd6drucCxma0MlFpUjVKM3qpAS7VIomSRWZVshhmql 4zoQOC1UoMkyH7VH/uIWC6P1u9cfR478hw53oRGpYNdwB/bQXQbfFNJcmBtdNjBJ2bvYApHFcpvNR klTeHXSi6Uomw/iKN1q1Fx0SLmWc3mPomwKP58m6lJSzUqkGRTmQqvC3AKFk8m8rf59XzwYKVXXhj tj3vhAx3NHh31UFHW/kBuW7D; Received: from muradm by localhost with local (Exim 4.95) (envelope-from ) id 1o0lKE-0002xC-SE for 49969@debbugs.gnu.org; Mon, 13 Jun 2022 17:45:54 +0300 From: muradm Date: Mon, 13 Jun 2022 17:45:45 +0300 Message-Id: <20220613144546.11306-8-mail@muradm.net> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220613144546.11306-1-mail@muradm.net> References: <6e4bf02cf382ff003951fc2f2bdf96289384ece2.camel@telenet.be> <20220613144546.11306-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 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=1655131703; 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=0W99EEv99FN153YGbGPNFdQpeAn3ENhoGEIIBdnLNzg=; b=qt7UzZSzjWWbL0maRhh/rmQYJuOJ5mBRVG+xSBjsC6W2liOkrbOcguiXC3htbnoCuE6CkH Yv7Y6567+2ujWoJK2Z9ffRj2QgZVABUhHJ87VaJTVBv+5RidbA35vonS6mq/0FIM0FbrIm 2iw3WOjh+Hoj984iuOonAsBkaWL3YL0oHksgP8EvMwF8h/dPD2kC9DMq8B1BKSGc84aYJH hJS+e5hIPrAi6xxiYpLa6gGY2oZnwsfazHcTdWlMS3ic7eIW1SQ6n1OlgA09rmbS9XOVRP 4bLnGyeeX+neZVQHe2FXp88gFzaE9D0zbI/RnQR4TjymVmSAiBda90mIHUVEZg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1655131703; a=rsa-sha256; cv=none; b=qbmBgQv+xXqTYQWo0tvUIB2D527DQ2ZgtoE2B4uUjZcagVD6buvLvgJT8Vjw+0l9GaC36n tDilOcElT8jG80kYr+nllxai3diAASHegv105eAwL3MVmXjJlmy6kUUxfcQC0iq9HqeMSq JnjsffFN6mmtkfJ/Ws1BElUPWCW7B9fIgKUA+ciOTQXc7Wy44uqUySw7gRVZM9zx+i0XBa IPQ5bXYzrjrcZyCfvxvwwcmheRD+LWHtYS28JCbkH/0ZXccN9pZjIHHLoVwO2tQjb1wfQy 5mglhYnUmC5OcMlsOiNJmoAJDwo58fli95vS7TzuhgZUnCdF+w2ZUVw9prf1wQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=muradm.net header.s=mail header.b=mJYBgS2H; dmarc=none; 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: 1.51 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=muradm.net header.s=mail header.b=mJYBgS2H; dmarc=none; 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: D4E991E1DF X-Spam-Score: 1.51 X-Migadu-Scanner: scn0.migadu.com X-TUID: B0xT/uFPVvPs * gnu/services/desktop.scm (seatd-service-type): New variable * gnu/services/desktop.scm (seatd-configuration): New data type fix seatd path --- doc/guix.texi | 46 +++++++++++++++++++++++++++++ gnu/services/desktop.scm | 62 +++++++++++++++++++++++++++++++++++++++- 2 files changed, 107 insertions(+), 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index 997b93c831..799ea932d7 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -22661,6 +22661,52 @@ 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{logfile} (default: @samp{"/var/log/seatd.log"}) +Log file to write to. + +@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 0499071436..29a3722f1b 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 @@ (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 + seatd-configuration + seatd-service-type + %desktop-services)) ;;; Commentary: @@ -1630,6 +1636,60 @@ (define polkit-wheel (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")) + (logfile seatd-logfile (default "/var/log/seatd.log")) + (loglevel seatd-loglevel (default "info"))) + +(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=" + #$(seatd-loglevel config)) + (string-append "SEATD_DEFAULTPATH=" + #$(seatd-socket config))) + #:log-file #$(seatd-logfile config))) + (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.36.1