system: guix: Use config's ACL file location.
* gnu/services/base.scm (substitute-key-authorization): Use %acl-file instead of hardcoded "/etc/guix/acl". Signed-off-by: Ludovic Courtès <ludo@gnu.org>master
parent
03856dce4e
commit
9f09903aff
|
@ -83,6 +83,7 @@
|
||||||
#:use-module (guix gexp)
|
#:use-module (guix gexp)
|
||||||
#:use-module (guix records)
|
#:use-module (guix records)
|
||||||
#:use-module (guix modules)
|
#:use-module (guix modules)
|
||||||
|
#:use-module (guix pki)
|
||||||
#:use-module ((guix self) #:select (make-config.scm))
|
#:use-module ((guix self) #:select (make-config.scm))
|
||||||
#:use-module (guix diagnostics)
|
#:use-module (guix diagnostics)
|
||||||
#:use-module (guix i18n)
|
#:use-module (guix i18n)
|
||||||
|
@ -1727,19 +1728,19 @@ archive' public keys, with GUIX."
|
||||||
(with-imported-modules '((guix build utils))
|
(with-imported-modules '((guix build utils))
|
||||||
#~(begin
|
#~(begin
|
||||||
(use-modules (guix build utils))
|
(use-modules (guix build utils))
|
||||||
|
(define acl-file #$%acl-file)
|
||||||
;; If the ACL already exists, move it out of the way. Create a backup
|
;; If the ACL already exists, move it out of the way. Create a backup
|
||||||
;; if it's a regular file: it's likely that the user manually updated
|
;; if it's a regular file: it's likely that the user manually updated
|
||||||
;; it with 'guix archive --authorize'.
|
;; it with 'guix archive --authorize'.
|
||||||
(if (file-exists? "/etc/guix/acl")
|
(if (file-exists? acl-file)
|
||||||
(if (and (symbolic-link? "/etc/guix/acl")
|
(if (and (symbolic-link? acl-file)
|
||||||
(store-file-name? (readlink "/etc/guix/acl")))
|
(store-file-name? (readlink acl-file)))
|
||||||
(delete-file "/etc/guix/acl")
|
(delete-file acl-file)
|
||||||
(rename-file "/etc/guix/acl" "/etc/guix/acl.bak"))
|
(rename-file acl-file (string-append acl-file ".bak")))
|
||||||
(mkdir-p "/etc/guix"))
|
(mkdir-p (dirname acl-file)))
|
||||||
|
|
||||||
;; Installed the declared ACL.
|
;; Installed the declared ACL.
|
||||||
(symlink #+default-acl "/etc/guix/acl"))))
|
(symlink #+default-acl acl-file))))
|
||||||
|
|
||||||
(define %default-authorized-guix-keys
|
(define %default-authorized-guix-keys
|
||||||
;; List of authorized substitute keys.
|
;; List of authorized substitute keys.
|
||||||
|
|
Reference in New Issue