Subject: [PATCH gnome-team v9 2/7] services: udev: Rewrite udev-rule to use file->udev-rule.

From: Vivien Kraus <[email-masked]>
Date: Thu, 5 Oct 2023 19:33:24 +0200

* gnu/services/base.scm (udev-rule): Use file->udev-rule.
---
 gnu/services/base.scm | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index b3f2d2e8b8..30372bf1b5 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -2212,19 +2212,7 @@ (define (udev-rules-union packages)
 
 (define (udev-rule file-name contents)
   "Return a directory with a udev rule file FILE-NAME containing CONTENTS."
-  (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"))
-
-                       (mkdir-p rules.d)
-                       (call-with-output-file
-                           (string-append rules.d "/" #$file-name)
-                         (lambda (port)
-                           (display #$contents port)))))))
+  (file->udev-rule file-name (plain-file file-name contents)))
 
 (define (file->udev-rule file-name file)
   "Return a directory with a udev rule file FILE-NAME which is a copy of FILE."
-- 
2.41.0