guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

20/45: services: udev: Rewrite udev-rule to use file->udev-rule.


From: guix-commits
Subject: 20/45: services: udev: Rewrite udev-rule to use file->udev-rule.
Date: Sun, 18 Feb 2024 08:41:06 -0500 (EST)

jpoiret pushed a commit to branch core-updates-glibc-2.39
in repository guix.

commit d4127f9a6feb3e015d7bfa57c1ea11fda1ef8b69
Author: Vivien Kraus <vivien@planete-kraus.eu>
AuthorDate: Thu Oct 5 19:33:24 2023 +0200

    services: udev: Rewrite udev-rule to use file->udev-rule.
    
    * 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 60388a22dd..2da29e65ba 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -2271,19 +2271,7 @@ item of @var{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."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]