[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC] refactoring extra-special-file; an /etc/tmpfiles/ equivalent
From: |
Attila Lendvai |
Subject: |
Re: [RFC] refactoring extra-special-file; an /etc/tmpfiles/ equivalent |
Date: |
Fri, 10 Feb 2023 13:38:05 +0000 |
> 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)