aboutsummaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
Diffstat (limited to 'gnu')
-rw-r--r--gnu/services/base.scm17
1 files changed, 17 insertions, 0 deletions
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 541ca76f14..b605614ab6 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -71,6 +71,7 @@
udev-service-type
udev-service
udev-rule
+ file->udev-rule
login-configuration
login-configuration?
@@ -1630,6 +1631,22 @@ item of @var{packages}."
(lambda (port)
(display #$contents port)))))))
+(define (file->udev-rule file-name file)
+ "Return a directory with a udev rule file FILE-NAME which is a copy of FILE."
+ (computed-file file-name
+ (with-imported-modules '((guix build utils))
+ #~(begin
+ (use-modules (guix build utils))
+
+ (define rules.d
+ (string-append #$output "/lib/udev/rules.d"))
+
+ (define file-copy-dest
+ (string-append rules.d "/" #$file-name))
+
+ (mkdir-p rules.d)
+ (copy-file #$file file-copy-dest)))))
+
(define kvm-udev-rule
;; Return a directory with a udev rule that changes the group of /dev/kvm to
;; "kvm" and makes it #o660. Apparently QEMU-KVM used to ship this rule,