me
/
guix
Archived
1
0
Fork 0

services: guix: Use "match-record" in activation.

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".
Brice Waegeneire 2021-07-17 14:39:56 +02:00
parent d0cc63ccc5
commit 92605326ae
No known key found for this signature in database
GPG Key ID: A94903A166A18FAE
1 changed files with 14 additions and 14 deletions

View File

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