From: Attila Lendvai <attila@lendvai.name>
To: Attila Lendvai <attila@lendvai.name>
Cc: guix-devel <guix-devel@gnu.org>
Subject: Re: [RFC] refactoring extra-special-file; an /etc/tmpfiles/ equivalent
Date: Fri, 10 Feb 2023 13:38:05 +0000 [thread overview]
Message-ID: <IK9rIziCodPKzAPpXW44oRXlG-TGs5YPrnmCbDMCpIvUc9phXBnI3H_vrPEQNeXLtOlkfN6RoRRKObcP32KSfvBzjcBpLxYKacqn7zRlc9o=@lendvai.name> (raw)
In-Reply-To: <hpUqi4h3P9vblzMwwWrayWYOOtSzWDpaA7JZHX5mxxgNYcHT9KGwfswvGXcRPmpAmO2Yg7jYIzD_ckAEphSI3IQ8EVjsd_oLUa8Gly9Pfb0=@lendvai.name>
> FTR, the "guixy way" currently is to add a service like this:
as mirai kindly instructed me on IRC, even though it's a somewhat widely spread solution, this has issues, as documented in: https://issues.guix.gnu.org/60657
instead, the proper way is to add a full-fledged one-shot shepherd service:
(simple-service
'disable-keyboard-wakeup
shepherd-root-service-type
(list
(shepherd-service
(requirement '(file-systems))
(provision '(disable-keyboard-wakeup))
(documentation "echo XHC >/proc/acpi/wakeup, so that my USB Kinesis keyboard doesn't wake up the laptop right after a suspend")
(one-shot? #t)
(start
#~(begin
(use-modules (ice-9 regex))
(use-modules (ice-9 textual-ports))
(lambda _
(when (string-match "XHC\t S3\t\\*enabled"
(call-with-input-file "/proc/acpi/wakeup"
get-string-all))
(display "Turning off usb wakeup\n")
(with-output-to-file "/proc/acpi/wakeup"
(lambda _
(display "XHC"))))))))))
and while we are at it, a newcomer feedback:
it's super confusing that there are 'guix services' and 'shepherd services', and they are rather different animals with very similar names, and they are present in a very confined context.
--
• attila lendvai
• PGP: 963F 5D5F 45C7 DFCD 0A39
--
“I will have to remember ‘I am here today to cross the swamp, not to fight all the alligators.’”
— Rosamund and Benjamin Zander, 'The Art of Possibility' (2002)
prev parent reply other threads:[~2023-02-10 13:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-21 15:29 [RFC] refactoring extra-special-file; an /etc/tmpfiles/ equivalent Attila Lendvai
2023-02-10 12:05 ` Attila Lendvai
2023-02-10 13:38 ` Attila Lendvai [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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='IK9rIziCodPKzAPpXW44oRXlG-TGs5YPrnmCbDMCpIvUc9phXBnI3H_vrPEQNeXLtOlkfN6RoRRKObcP32KSfvBzjcBpLxYKacqn7zRlc9o=@lendvai.name' \
--to=attila@lendvai.name \
--cc=guix-devel@gnu.org \
/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 external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.