diff mbox series

[bug#49610,1/2] services: guix: Use "match-record" in activation.

Message ID 20210717210424.1921-1-brice@waegenei.re
State New
Headers show
Series Add channels field to guix-configuration | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue

Commit Message

Brice Waegeneire July 17, 2021, 9:04 p.m. UTC
It's more explicit to specify used fields instead of depending on their
position.

* gnu/services/base.scm (guix-activation): Replace "match" with
  "match-record".
---
 gnu/services/base.scm | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

Comments

Ludovic Courtès July 21, 2021, 9:47 p.m. UTC | #1
Hello,

Brice Waegeneire <brice@waegenei.re> skribis:

> It's more explicit to specify used fields instead of depending on their
> position.
>
> * gnu/services/base.scm (guix-activation): Replace "match" with
>   "match-record".

LGTM!

Ludo’.
Brice Waegeneire Aug. 4, 2021, 4:42 a.m. UTC | #2
Hello Ludo‘,

Ludovic Courtès <ludo@gnu.org> writes:

> Brice Waegeneire <brice@waegenei.re> skribis:
>
>> It's more explicit to specify used fields instead of depending on their
>> position.
>>
>> * gnu/services/base.scm (guix-activation): Replace "match" with
>>   "match-record".
>
> LGTM!

Thanks, pushed as 92605326ae909471d17b0db51504e810989989f8.

Cheers,
- Brice
diff mbox series

Patch

diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index ab3e441a7b..e206bea5f0 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -12,7 +12,7 @@ 
 ;;; Copyright © 2019 John Soo <jsoo1@asu.edu>
 ;;; Copyright © 2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2020 Florian Pelz <pelzflorian@pelzflorian.de>
-;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re>
+;;; Copyright © 2020, 2021 Brice Waegeneire <brice@waegenei.re>
 ;;; Copyright © 2021 qblade <qblade@protonmail.com>
 ;;; Copyright © 2021 Hui Lu <luhuins@163.com>
 ;;;
@@ -1700,21 +1700,21 @@  proxy of 'guix-daemon'...~%")
 
 (define (guix-activation config)
   "Return the activation gexp for CONFIG."
-  (match config
-    (($ <guix-configuration> guix build-group build-accounts authorize-key? keys)
-     ;; Assume that the store has BUILD-GROUP as its group.  We could
-     ;; otherwise call 'chown' here, but the problem is that on a COW overlayfs,
-     ;; chown leads to an entire copy of the tree, which is a bad idea.
+  (match-record config <guix-configuration>
+    (guix authorize-key? authorized-keys)
+    #~(begin
+        ;; Assume that the store has BUILD-GROUP as its group.  We could
+        ;; otherwise call 'chown' here, but the problem is that on a COW overlayfs,
+        ;; chown leads to an entire copy of the tree, which is a bad idea.
 
-     ;; Generate a key pair and optionally authorize substitute server keys.
-     #~(begin
-         (unless (file-exists? "/etc/guix/signing-key.pub")
-           (system* #$(file-append guix "/bin/guix") "archive"
-                    "--generate-key"))
+        ;; Generate a key pair and optionally authorize substitute server keys.
+        (unless (file-exists? "/etc/guix/signing-key.pub")
+          (system* #$(file-append guix "/bin/guix") "archive"
+                   "--generate-key"))
 
-         #$(if authorize-key?
-               (substitute-key-authorization keys guix)
-               #~#f)))))
+        #$(if authorize-key?
+              (substitute-key-authorization authorized-keys guix)
+              #~#f))))
 
 (define* (references-file item #:optional (name "references"))
   "Return a file that contains the list of references of ITEM."