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 6KBOABnHImE39AAAgWs5BA (envelope-from ) for ; Sun, 22 Aug 2021 23:52:25 +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 CElwNxjHImE5BwAAbx9fmQ (envelope-from ) for ; Sun, 22 Aug 2021 21:52:24 +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 886601BB88 for ; Sun, 22 Aug 2021 23:52:24 +0200 (CEST) Received: from localhost ([::1]:50426 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mHvOB-0008Sk-LT for larch@yhetil.org; Sun, 22 Aug 2021 17:52:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54964) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mHvNs-0007uW-Bn for guix-patches@gnu.org; Sun, 22 Aug 2021 17:52:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:56632) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mHvNs-0002wF-3u for guix-patches@gnu.org; Sun, 22 Aug 2021 17:52:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mHvNs-0007e3-31 for guix-patches@gnu.org; Sun, 22 Aug 2021 17:52:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49969] [PATCH v5 05/10] gnu: desktop: Add seatd-service-type Resent-From: muradm Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 22 Aug 2021 21:52: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.162966907929265 (code B ref 49969); Sun, 22 Aug 2021 21:52:04 +0000 Received: (at 49969) by debbugs.gnu.org; 22 Aug 2021 21:51:19 +0000 Received: from localhost ([127.0.0.1]:39930 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mHvN8-0007br-Ps for submit@debbugs.gnu.org; Sun, 22 Aug 2021 17:51:19 -0400 Received: from mail-ej1-f44.google.com ([209.85.218.44]:38584) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mHvN0-0007a5-6X for 49969@debbugs.gnu.org; Sun, 22 Aug 2021 17:51:10 -0400 Received: by mail-ej1-f44.google.com with SMTP id n27so776741eja.5 for <49969@debbugs.gnu.org>; Sun, 22 Aug 2021 14:51:10 -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=JWXU6HNjKXKLPCZywxFJOAG5aPyg02aaFLYIgFA2r9wJ5BsHodWxtKErfaM2LXTnjU rNNl4Eyh0aOYNd97Bm1SMiQSVOChoRkLjOjLM69V/ZBf1TtsbHOqwMrbl7gDlrHjoEht TaE91eSMhB8LnUR0aCIF8p1KihF0Si+uUST8fPHoTzXjgmduusaMDWHc5+zLI2UL3/wz anXP6nfaeTgpczgzxxufZX++e93QXrlL14DwjgrmeK11bPkGRFjFZGi0Wo5QWulT50uh DwQhnPB3sJ6NxU3JbdyyPdpUsO1Bfdu5egVTOtlntXJF2jgRS9VlxDltQr6E72rFNjGx SZ9g== 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=i41FCDbzRuuhFdcJOHtEFjISX2O5/+E/TqwXTraBCBxba5Yi4qgm65ODpfhkJ9Svrp 7X1zCbX8hJJHQiQlT7HuzpGl3I7PsLlII+ISpk+TRNsPk6XmVFfJgGbid8MBJJOgvKqy QqzRhepUU9Rb7Rjf+0Ntno83BVR6f5n6AwT2LTtWzLcI2eDaed9hoa9xH9FyG01tiWFB AmSxCP4HnvV01cTkuLC/pbNQw0odnize7WISGC48jkWW6fzFXcQfJKZirHHCS2nW/+X6 bccLK0748iuD2tmV72CD+6DfVGuSHmkjdwaOfOlGDIPaplaxQlV0fjOx1yH4738Bg3ej IbZQ== X-Gm-Message-State: AOAM532PvPTT+/PW1YQ3Jp8UFQzxn3MLN44yBkGtSYgA5UvzOPAT55OJ YT7SyevqxrsRXpEm+puBnDpcwnOMMkcAGQ== X-Google-Smtp-Source: ABdhPJwxPsBRo2+HE0T72ud1LXzvKMsQ2ZWrPJxtZLSfg1RR8vRAi+nQEA76tjL6d+jfqKoF4cqgGA== X-Received: by 2002:a17:906:1994:: with SMTP id g20mr24406962ejd.397.1629669064223; Sun, 22 Aug 2021 14:51:04 -0700 (PDT) Received: from localhost.localdomain ([31.142.76.217]) by smtp.gmail.com with ESMTPSA id q5sm7959755edt.50.2021.08.22.14.51.03 for <49969@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Aug 2021 14:51:03 -0700 (PDT) From: muradm Date: Mon, 23 Aug 2021 00:50:43 +0300 Message-Id: <20210822215048.20480-6-mail@muradm.net> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210822215048.20480-1-mail@muradm.net> References: <20210819143133.6398-1-mail@muradm.net> <20210822215048.20480-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=1629669144; 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=bKuzd/nDSYtnUvv2dZ6PtqKZxiErAteqRFaeYOsm5HPeMIoTtVySPVeT9QV4yAbcuQO47c IqsxLzzVDf8SMa2UhOjLp5GtiheHt8T/nnJm871sK4BvDjQ4ghvjB74kmXy5hthDIPsFp1 FQdmN8XhF38AANpapuefeVCiUpzIVnGv/NaT8b+b5lIWtazk8gxi5wUikYpU+6xuCjDEf5 F0YqCd1N3alrEI/wquNgSsZhuxrj/Hx7mjgC4HjXWKzwXb18wddcI8gSelyww/Ph2Vg/8x bsACmhCTEnRfwmBmZdv65HRR4+CDG+ruQvBLXsy2eJRg0YrjUwTe4LJBdMvaPg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1629669144; a=rsa-sha256; cv=none; b=t0wWRofjCmZ24UQU2LUTkreHMdn5obKWKHCZ4289Sji8BW0wWaxy/XZV/Hy1OnuWj2/u16 hFyt/KXYZpdqAkIUpViOOPl4rN9MB6N1/nTalKM2qMDrSibZ1gGPsfVDbkHTW4/IRbMvjX V7bc3sRThGm2TZQWAvj87KYy9R3IbA0LFvlniA/6KbVt0swZsU+0aInBUg2pznfKhCgbww /yYjow3UweGsRBYUOiHhDIMXAYnCC4nOuoGXRjGcwehLSZ1P4hvDntbZjUjgKCTwtzM3C6 dy2lqWppU3i5YTtvYF14SM5X9+zvn2Nfsj35XpdG8zIQ+mSRJ1+tdrK5Y6XjiQ== 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=JWXU6HNj; 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.43 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=muradm-net.20150623.gappssmtp.com header.s=20150623 header.b=JWXU6HNj; 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: 886601BB88 X-Spam-Score: -0.43 X-Migadu-Scanner: scn0.migadu.com X-TUID: lCmrombPN73s * 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