diff mbox series

[bug#66794] gnu: beep: Add phase install-rules.

Message ID 20231028141652.5940-1-ngraves@ngraves.fr
State New
Headers show
Series [bug#66794] gnu: beep: Add phase install-rules. | expand

Commit Message

Nicolas Graves Oct. 28, 2023, 2:16 p.m. UTC
* gnu/packages/terminals.scm (beep): Add phase install-rules.
---
 gnu/packages/terminals.scm | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

Comments

Ludovic Courtès Dec. 4, 2023, 8:57 p.m. UTC | #1
Nicolas Graves <ngraves@ngraves.fr> skribis:

> * gnu/packages/terminals.scm (beep): Add phase install-rules.

Applied, thanks!
diff mbox series

Patch

diff --git a/gnu/packages/terminals.scm b/gnu/packages/terminals.scm
index c5cecfa6db..b3f17c7ed2 100644
--- a/gnu/packages/terminals.scm
+++ b/gnu/packages/terminals.scm
@@ -584,7 +584,18 @@  (define-public beep
                      ;; The build environment lacks /dev/{console,tty*}.
                      ;; In fact, even nckx's regular Guix System lacks ttyS1…
                      ((": Permission denied")
-                      ": No such file or directory")))))))
+                      ": No such file or directory"))))
+               (add-before 'install 'install-rules
+                 (lambda _
+                   (mkdir-p (string-append #$output "/etc/udev/rules.d"))
+                   (with-output-to-file
+                       (string-append #$output
+                                      "/etc/udev/rules.d/70-pcspkr-beep.rules")
+                     (lambda _
+                       (display (string-append "\
+ACTION==\"add\", SUBSYSTEM==\"input\", ATTRS{name}==\"PC Speaker\", "
+                                               "ENV{DEVNAME}!=\"\", "
+                                               "TAG+=\"uaccess\"")))))))))
     (synopsis "Linux command-line utility to control the PC speaker")
     (description "beep allows the user to control the PC speaker with precision,
 allowing different sounds to indicate different events.  While it can be run