From: "Ludovic Courtès" <ludo@gnu.org>
To: 45mg <45mg.writes@gmail.com>
Cc: Simon Tournier <zimon.toutoune@gmail.com>,
paren@disroot.org, Tobias Geerinckx-Rice <me@tobias.gr>,
jgart <jgart@dismail.de>,
74819@debbugs.gnu.org, Mathieu Othacehe <othacehe@gnu.org>,
Christopher Baines <guix@cbaines.net>
Subject: [bug#74819] [PATCH v3] services: elogind: Support Hook Directories
Date: Mon, 23 Dec 2024 19:00:24 +0100 [thread overview]
Message-ID: <874j2u8ekn.fsf@gnu.org> (raw)
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")
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: boolean)
> +@item @code{allow-suspend-interrupts?} (default: @code{#f}) (type: boolean)
Write “@itemx” 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 “elogind” 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: boolean)
“@itemx” as well.
> +(define (/etc/elogind config)
By convention, I’d call it ‘elogind-etc-directory’.
> + #~(let ((sleep-dir (string-append #$output "/system-sleep/"))
> + (shutdown-dir (string-append #$output "/system-shutdown/")))
> + (use-modules (guix build utils))
‘use-modules’ should always be used at the top level; it’s not
guaranteed to work otherwise (it wouldn’t 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"))
…)
Apart from these minor issues, the patch looks great to me.
Could you send an updated version?
Thanks!
Ludo’.
prev parent reply other threads:[~2024-12-23 18:01 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-12 11:33 [bug#74819] [PATCH] services: elogind: Support Hook Directories 45mg
2024-12-12 13:00 ` 45mg
2024-12-16 6:26 ` [bug#74819] [PATCH v2] " 45mg
2024-12-16 6:37 ` 45mg
2024-12-18 12:18 ` [bug#74819] [PATCH v3] " 45mg
2024-12-23 18:00 ` Ludovic Courtès [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=874j2u8ekn.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=45mg.writes@gmail.com \
--cc=74819@debbugs.gnu.org \
--cc=guix@cbaines.net \
--cc=jgart@dismail.de \
--cc=me@tobias.gr \
--cc=othacehe@gnu.org \
--cc=paren@disroot.org \
--cc=zimon.toutoune@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).