From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id aEaOBGilaWdyaQEAe85BDQ:P1 (envelope-from ) for ; Mon, 23 Dec 2024 18:01:12 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id aEaOBGilaWdyaQEAe85BDQ (envelope-from ) for ; Mon, 23 Dec 2024 19:01:12 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=itOvmC+N; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=Xzf0HYW8; 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"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1734976872; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=WSK/zWp/nFTLuAEhsV3KVfEpIdzWBb+XlfTo6tnAe74=; b=d/yRSMXLyMRdThYdMwOVfLRnSzwhl3zBHf+sKXQyhfAGBUu+URRoY6s81sFqvR1hNtD2sR Tz91sw5l4k96uI7UZtuFW0QJOUzHPFg0RGq70hIhyMErjj53PXhCGRMXwHPaHl5wlK2yAD hSrVL9pX2lk0uxTz3jyu0nLVhz110vU30Y65g7GC4I5JDpK/Up8kF+lmSLTOKVZEv1HQxZ puT1zLxQ8yZvM5tZIVn1a3FcBytPzQNTq+zIfSRPiOAeoaVv+OryKPjPN7FYR0EcReh+Jl +HJjG+oOfr6PbqBG2KsvZJcEmOCqAU7jNP3CIks/ukeS94VNQQ9LMob6KBc6bA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=itOvmC+N; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=Xzf0HYW8; 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"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1734976872; a=rsa-sha256; cv=none; b=RxamwzC8sAdxfUbv52VidwJZy6xSnZusvFqP+kxgLl+W00HD3YxUTRRe6ncyhUTBkyoQw/ Jazg30Bp1fjP8jAK9W+eiwR4wSdrXoHEx/cMmIdW8y5L2o0IJNboZm3jN06+FdG+04b6mO hKeKOz+TGIVaKiBcqr1fNGEN4Y0OlxnvGvI5HLAxCEoTTDCvBIUHRRRMZuQHA9aqgHKzCe G5qIsuDezYumiuC2Na+XL/xqoXXFiaLrFgfEjPB4LAMcXjyjHm3SwsUkGRiv6NWDd6TXm4 edIJzfMuPYz5s4qq1yXjx/NPIh3oPthxeom1hdt5cRaEQ62Js8dW5Rz2sscE3A== 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 304C03801C for ; Mon, 23 Dec 2024 19:01:10 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tPmjq-0001As-GU; Mon, 23 Dec 2024 13:01:06 -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 1tPmjo-00016e-Qh for guix-patches@gnu.org; Mon, 23 Dec 2024 13:01:05 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tPmjo-0006w0-Gr for guix-patches@gnu.org; Mon, 23 Dec 2024 13:01:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=WSK/zWp/nFTLuAEhsV3KVfEpIdzWBb+XlfTo6tnAe74=; b=itOvmC+NzxsfFduyjSj8VV01IMxA3J1ZOBDLo3xvIcK/cPW9FkM5wxJKKdQCxs9GexyY7onNbPi8mjI+xJUxWXEW02oY7mBTwDiBwBjPmb4QcRR5drpEgi6Igfz+OeDX7vh7H8OrVx/x5J50grCmPc5nSYTN10BjFLKPQbw0LJO4A12DxTUl23nNCa5+OcJwe06NfCKuHvaT3ExsB2McVndhQMRkuSSXV8v43wT60mlLR+zPMuyT3n06eVMptobid6HZUm4rMeAA9otTVtn9NNH2YeTnR9s67dmjlD8Wf6ThdlGIjl456bxH4wdnzGEkhjeanpQ1o93Q96XDXglZTw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tPmjn-000200-Qo for guix-patches@gnu.org; Mon, 23 Dec 2024 13:01:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74819] [PATCH v3] services: elogind: Support Hook Directories Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 23 Dec 2024 18:01:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74819 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 45mg <45mg.writes@gmail.com> Cc: Simon Tournier , paren@disroot.org, Tobias Geerinckx-Rice , jgart , 74819@debbugs.gnu.org, Mathieu Othacehe , Christopher Baines Received: via spool by 74819-submit@debbugs.gnu.org id=B74819.17349768447634 (code B ref 74819); Mon, 23 Dec 2024 18:01:03 +0000 Received: (at 74819) by debbugs.gnu.org; 23 Dec 2024 18:00:44 +0000 Received: from localhost ([127.0.0.1]:56070 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tPmjT-0001yy-H2 for submit@debbugs.gnu.org; Mon, 23 Dec 2024 13:00:44 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54138) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tPmjM-0001yU-Sz for 74819@debbugs.gnu.org; Mon, 23 Dec 2024 13:00:38 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tPmjF-0006mK-Gl; Mon, 23 Dec 2024 13:00:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=WSK/zWp/nFTLuAEhsV3KVfEpIdzWBb+XlfTo6tnAe74=; b=Xzf0HYW8j4Y41T76pS2r KIvuk9EHCkI5MGO7H8WeAjH6lP2IfdKEDa4nroXy/epDW8UV/KUKkZ9ymVkHToyytn7Y9iG/qSaoR NNLCh6UWu2hyT4kriSABFtOJRpveNH8ds/mbIlzv4aX65btXgY4cqqeU4ba37rfKnc8tZ5hs99D8t KyKNZlwUveIsaoSvwniA6xLrBPuGr/y0rPh6FOkDs1MwwY3lsK8uguxLK1AfZY4r4lxhBs+F8+Sk4 XJJMltxTHw3FNWQ1tPP02xrKnrtIBIDj1w+AStmfvwcmOVrCmHRh0WK3DcEXvCzDpqfkfCuj9in5j X07pf753dOZ8NQ==; From: Ludovic =?UTF-8?Q?Court=C3=A8s?= In-Reply-To: <1688c8ebd2c7d074edce3b27c0e439c5897ee251.1734524329.git.45mg.writes@gmail.com> (45mg.writes@gmail.com's message of "Wed, 18 Dec 2024 07:18:49 -0500") References: <7286c9dd75c4853f5811720150c027b9d9b511d7.1734003226.git.45mg.writes@gmail.com> <1688c8ebd2c7d074edce3b27c0e439c5897ee251.1734524329.git.45mg.writes@gmail.com> Date: Mon, 23 Dec 2024 19:00:24 +0100 Message-ID: <874j2u8ekn.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -0.91 X-Spam-Score: -0.91 X-Migadu-Queue-Id: 304C03801C X-TUID: CS8HLD6BrZbC Hi, 45mg <45mg.writes@gmail.com> skribis: > Allow the user to specify scripts to be added into Elogind's hook > directories. These scripts will be run before/after > suspend/hibernate/poweroff/reboot. > > Also allow setting the associated config options. > > * gnu/services/desktop.scm (elogind-configuration): add > `system-sleep-hook-files`, `system-shutdown-hook-files`, > and 4 new config options. > (elogind-configuration-file): Add entries for the new config options > under the `[Sleep]` section. > (/etc/elogind): New function, to generate /etc/elogind directory. > (elogind-service-type): Extend `etc-service-type` using `/etc/elogind`. > * doc/guix.texi: Document the new options. > > Change-Id: I7e22cbaa9d031049b9d085ba0ce4cc8a8b4f16ff Nice! [...] > +@item @code{allow-power-off-interrupts?} (default: @code{#f}) (type: boo= lean) > +@item @code{allow-suspend-interrupts?} (default: @code{#f}) (type: boole= an) Write =E2=80=9C@itemx=E2=80=9D for the second line: both will show up next = to one another. > +Whether the executables in Elogind's hook directories (see above) can I believe =E2=80=9Celogind=E2=80=9D is usually spelled lower-case. > +@item @code{broadcast-power-off-interrupts?} (default: @code{#t}) (type:= boolean) > +@item @code{broadcast-suspend-interrupts?} (default: @code{#t}) (type: b= oolean) =E2=80=9C@itemx=E2=80=9D as well. > +(define (/etc/elogind config) By convention, I=E2=80=99d call it =E2=80=98elogind-etc-directory=E2=80=99. > + #~(let ((sleep-dir (string-append #$output "/system-sleep/")) > + (shutdown-dir (string-append #$output "/system-shutdown/"))) > + (use-modules (guix build utils)) =E2=80=98use-modules=E2=80=99 should always be used at the top level; it=E2= =80=99s not guaranteed to work otherwise (it wouldn=E2=80=99t work if the module exports macros, for instance). Also, please avoid abbreviations. So that gives something like: #~(begin (use-modules (guix build utils)) (define sleep-directory (string-append #$output "/system-sleep")) (define shutdown-directory (string-append #$output "/system-shutdown"= )) =E2=80=A6) Apart from these minor issues, the patch looks great to me. Could you send an updated version? Thanks! Ludo=E2=80=99.