From patchwork Sat Feb 25 18:58:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruno Victal X-Patchwork-Id: 47324 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 550B116BA4; Sat, 25 Feb 2023 19:01:05 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id A90F916B42 for ; Sat, 25 Feb 2023 19:00:58 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pVzmB-0002as-Id; Sat, 25 Feb 2023 14:00:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pVzm8-0002Wf-Kb for guix-patches@gnu.org; Sat, 25 Feb 2023 14:00:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pVzm8-00011D-At for guix-patches@gnu.org; Sat, 25 Feb 2023 14:00:04 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pVzm8-00081n-7i for guix-patches@gnu.org; Sat, 25 Feb 2023 14:00:04 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#61789] [PATCH 15/27] services: desktop: Deprecate 'elogind-service' procedure. Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 25 Feb 2023 19:00:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61789 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 61789@debbugs.gnu.org Cc: Bruno Victal Received: via spool by 61789-submit@debbugs.gnu.org id=B61789.167735156530722 (code B ref 61789); Sat, 25 Feb 2023 19:00:04 +0000 Received: (at 61789) by debbugs.gnu.org; 25 Feb 2023 18:59:25 +0000 Received: from localhost ([127.0.0.1]:41500 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pVzlU-0007zK-R3 for submit@debbugs.gnu.org; Sat, 25 Feb 2023 13:59:25 -0500 Received: from smtpm8.myservices.hosting ([185.26.105.209]:46052) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pVzkq-0007ut-Tk for 61789@debbugs.gnu.org; Sat, 25 Feb 2023 13:58:45 -0500 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpm8.myservices.hosting (Postfix) with ESMTP id D3AE520D4F for <61789@debbugs.gnu.org>; Sat, 25 Feb 2023 19:58:23 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id BFD638009E; Sat, 25 Feb 2023 19:58:23 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-2.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id FwEiYe_yrp0O; Sat, 25 Feb 2023 19:58:22 +0100 (CET) Received: from guix-nuc.home.arpa (bl9-119-177.dsl.telepac.pt [85.242.119.177]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id AEB838009A; Sat, 25 Feb 2023 19:58:21 +0100 (CET) From: Bruno Victal Date: Sat, 25 Feb 2023 18:58:01 +0000 Message-Id: X-Mailer: git-send-email 2.39.1 In-Reply-To: References: MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * doc/guix.texi (Desktop Services): Replace 'elogind-service' with 'elogind-service-type'. * gnu/services/desktop.scm (elogind-service): Deprecate procedure. (desktop-services-for-system): Use elogind-service-type. * gnu/tests/lightdm.scm (minimal-desktop-services): Ditto. --- doc/guix.texi | 166 ++++++++++++++++++++++++--------------- gnu/services/desktop.scm | 7 +- gnu/tests/lightdm.scm | 2 +- 3 files changed, 106 insertions(+), 69 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 05900d514a..2d69f94aa0 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -23312,77 +23312,113 @@ Desktop Services @var{services} must be equal to @code{(list avahi)}. @end deffn -@deffn {Scheme Procedure} elogind-service [#:config @var{config}] -Return a service that runs the @code{elogind} login and -seat management daemon. @uref{https://github.com/elogind/elogind, -Elogind} exposes a D-Bus interface that can be used to know which users +@subsubheading Elogind + +@uref{https://github.com/elogind/elogind, Elogind} is a login and seat +management daemon that also handles most system-level power events for a +computer, for example suspending the system when a lid is closed, or +shutting it down when the power button is pressed. + +It also provides a D-Bus interface that can be used to know which users are logged in, know what kind of sessions they have open, suspend the system, inhibit system suspend, reboot the system, and other tasks. -Elogind handles most system-level power events for a computer, for -example suspending the system when a lid is closed, or shutting it down -when the power button is pressed. +@defvar elogind-service-type +Type of the service that runs @command{elogind}, a login and +seat management daemon. The value for this service is a +@code{} object. +@end defvar -The @var{config} keyword argument specifies the configuration for -elogind, and should be the result of an @code{(elogind-configuration -(@var{parameter} @var{value})...)} invocation. Available parameters and -their default values are: +@c TODO: field descriptions. This is best done by refactoring +@c elogind-configuration to use define-configuration which embeds the +@c descriptions in the code and then use configuration->documentation. +@deftp {Data Type} elogind-configuration +Data type representing the configuration of @command{elogind}. + +@table @asis +@item @code{elogind} (default: @code{elogind}) (type: file-like) +... + +@item @code{kill-user-processes?} (default: @code{#f}) (type: boolean) +... + +@item @code{kill-only-users} (default: @code{'()}) (type: list) +... + +@item @code{kill-exclude-users} (default: @code{'("root")}) (type: list-of-string) +... + +@item @code{inhibit-delay-max-seconds} (default: @code{5}) (type: integer) +... + +@item @code{handle-power-key} (default: @code{'poweroff}) (type: symbol) +... + +@item @code{handle-suspend-key} (default: @code{'suspend}) (type: symbol) +... + +@item @code{handle-hibernate-key} (default: @code{'hibernate}) (type: symbol) +... + +@item @code{handle-lid-switch} (default: @code{'suspend}) (type: symbol) +... + +@item @code{handle-lid-switch-docked} (default: @code{'ignore}) (type: symbol) +... + +@item @code{handle-lid-switch-external-power} (default: @code{*unspecified*}) (type: symbol) +... + +@item @code{power-key-ignore-inhibited?} (default: @code{#f}) (type: boolean) +... + +@item @code{suspend-key-ignore-inhibited?} (default: @code{#f}) (type: boolean) +... + +@item @code{hibernate-key-ignore-inhibited?} (default: @code{#f}) (type: boolean) +... + +@item @code{lid-switch-ignore-inhibited?} (default: @code{#t}) (type: boolean) +... + +@item @code{holdoff-timeout-seconds} (default: @code{30}) (type: integer) +... + +@item @code{idle-action} (default: @code{'ignore}) (type: symbol) +... + +@item @code{idle-action-seconds} (default: @code{(* 30 60)}) (type: integer) +... + +@item @code{runtime-directory-size-percent} (default: @code{10}) (type: integer) +... + +@item @code{runtime-directory-size} (default: @code{#f}) (type: integer) +... + +@item @code{remove-ipc?} (default: @code{#t}) (type: boolean) +... + +@item @code{suspend-state} (default: @code{'("mem" "standby" "freeze")}) (type: list) +... + +@item @code{suspend-mode} (default: @code{'()}) (type: list) +... + +@item @code{hibernate-state} (default: @code{'("disk")}) (type: list) +... + +@item @code{hibernate-mode} (default: @code{'("platform" "shutdown")}) (type: list) +... + +@item @code{hybrid-sleep-state} (default: @code{'("disk")}) (type: list) +... + +@item @code{hybrid-sleep-mode} (default: @code{'("suspend" "platform" "shutdown")}) (type: list) +... -@table @code -@item kill-user-processes? -@code{#f} -@item kill-only-users -@code{()} -@item kill-exclude-users -@code{("root")} -@item inhibit-delay-max-seconds -@code{5} -@item handle-power-key -@code{poweroff} -@item handle-suspend-key -@code{suspend} -@item handle-hibernate-key -@code{hibernate} -@item handle-lid-switch -@code{suspend} -@item handle-lid-switch-docked -@code{ignore} -@item handle-lid-switch-external-power -@code{*unspecified*} -@item power-key-ignore-inhibited? -@code{#f} -@item suspend-key-ignore-inhibited? -@code{#f} -@item hibernate-key-ignore-inhibited? -@code{#f} -@item lid-switch-ignore-inhibited? -@code{#t} -@item holdoff-timeout-seconds -@code{30} -@item idle-action -@code{ignore} -@item idle-action-seconds -@code{(* 30 60)} -@item runtime-directory-size-percent -@code{10} -@item runtime-directory-size -@code{#f} -@item remove-ipc? -@code{#t} -@item suspend-state -@code{("mem" "standby" "freeze")} -@item suspend-mode -@code{()} -@item hibernate-state -@code{("disk")} -@item hibernate-mode -@code{("platform" "shutdown")} -@item hybrid-sleep-state -@code{("disk")} -@item hybrid-sleep-mode -@code{("suspend" "platform" "shutdown")} @end table -@end deffn +@end deftp @deffn {Scheme Procedure} accountsservice-service @ [#:accountsservice @var{accountsservice}] diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm index d4ac88311f..bc8f4eb026 100644 --- a/gnu/services/desktop.scm +++ b/gnu/services/desktop.scm @@ -114,7 +114,7 @@ (define-module (gnu services desktop) elogind-configuration elogind-configuration? - elogind-service + elogind-service ; deprecated elogind-service-type %gdm-file-system @@ -1216,7 +1216,8 @@ (define elogind-service-type their session types (graphical, console, remote, etc.). It can also clean up after users when they log out."))) -(define* (elogind-service #:key (config (elogind-configuration))) +(define-deprecated (elogind-service #:key (config (elogind-configuration))) + elogind-service-type "Return a service that runs the @command{elogind} login and seat management service. The @command{elogind} service integrates with PAM to allow other system components to know the set of logged-in users as well as their session @@ -1807,7 +1808,7 @@ (define* (desktop-services-for-system #:optional (service colord-service-type) (geoclue-service) (service polkit-service-type) - (elogind-service) + (service elogind-service-type) (dbus-service) (service ntp-service-type) diff --git a/gnu/tests/lightdm.scm b/gnu/tests/lightdm.scm index 57d029a75a..25fa06a9f1 100644 --- a/gnu/tests/lightdm.scm +++ b/gnu/tests/lightdm.scm @@ -48,7 +48,7 @@ (define minimal-desktop-services (service upower-service-type) (accountsservice-service) (service polkit-service-type) - (elogind-service) + (service elogind-service-type) (dbus-service) x11-socket-directory-service))