Subject: [bug#42682] [PATCH v3 9/9] gnu: Add qmk-udev-rules.

From: Fredrik Salomonsson <[email-masked]>
Date: Sun, 28 May 2023 23:44:07 +0000

* gnu/packages/hardware.scm (qmk-udev-rules): New variable.
---
 gnu/packages/hardware.scm | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/gnu/packages/hardware.scm b/gnu/packages/hardware.scm
index ebf5f47e1a..e01eb320f2 100644
--- a/gnu/packages/hardware.scm
+++ b/gnu/packages/hardware.scm
@@ -1485,3 +1485,27 @@ (define-public qmk-cli
 recommended to setup udev rules to avoid running this as root when flashing
 the firmware, see @code{qmk-udev-rules} and @code{udev-service-type}.")
     (license license:expat)))
+
+(define-public qmk-udev-rules
+  (package
+    (name "qmk-udev-rules")
+    (version "0.20.5") ;; Using qmk_firmware's version
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/qmk/qmk_firmware")
+                    (commit version)))
+              (sha256
+               (base32
+                "0v45xvmv351717y2v77fy26ivsnnhsl6ynd7v1pvprpkpf9jk820"))))
+    (build-system copy-build-system)
+    (arguments
+     '(#:install-plan '(("./util/udev" "lib/udev/rules.d"
+                         #:include-regexp ("rules$")))))
+    (home-page "https://github.com/qmk/qmk_firmware")
+    (synopsis "Udev rules for QMK Firmware")
+    (description
+     "This package provides a set of udev rules to specify the proper
+privileges for flashing QMK compatible devices without needing root.  Require
+group @code{plugdev} to be added to each user that needs this.")
+    (license license:gpl2)))
-- 
2.40.1