summary refs log tree commit diff
diff options
context:
space:
mode:
authorNicolas Graves <ngraves@ngraves.fr>2023-10-28 16:16:46 +0200
committerLudovic Courtès <ludo@gnu.org>2023-12-04 22:26:36 +0100
commitff9d32df33dc80e5a04bdff80f780cb09f726006 (patch)
treee01d98df947b8efbf7463f3e4b8d7ada8295d1d3
parentaf2735e874232d0ba46e2e943f0ba4697c42f70f (diff)
downloadguix-ff9d32df33dc80e5a04bdff80f780cb09f726006.tar.gz
gnu: beep: Add phase install-rules.
* gnu/packages/terminals.scm (beep): Add phase install-rules.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
-rw-r--r--gnu/packages/terminals.scm13
1 files changed, 12 insertions, 1 deletions
diff --git a/gnu/packages/terminals.scm b/gnu/packages/terminals.scm
index 27b1e1a2ac..b754e4c166 100644
--- a/gnu/packages/terminals.scm
+++ b/gnu/packages/terminals.scm
@@ -603,7 +603,18 @@ to all types of devices that provide serial consoles.")
                      ;; 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