all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Josselin Poiret via Guix-patches via <guix-patches@gnu.org>
To: Josselin Poiret <dev@jpoiret.xyz>, 63057@debbugs.gnu.org
Subject: [bug#63057] [PATCH core-updates 1/3] system: guix: Use config's ACL file location.
Date: Mon, 24 Apr 2023 21:59:03 +0200	[thread overview]
Message-ID: <e1effe129a8561082a0cf59a84004737a9fda308.1682364024.git.dev@jpoiret.xyz> (raw)
In-Reply-To: <cover.1682364024.git.dev@jpoiret.xyz>

* gnu/services/base.scm (substitute-key-authorization): Use %acl-file instead of
hardcoded "/etc/guix/acl".
---
 gnu/services/base.scm | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index e8eae72aa2..4adb551796 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -83,6 +83,7 @@ (define-module (gnu services base)
   #:use-module (guix gexp)
   #:use-module (guix records)
   #:use-module (guix modules)
+  #:use-module (guix pki)
   #:use-module ((guix self) #:select (make-config.scm))
   #:use-module (guix diagnostics)
   #:use-module (guix i18n)
@@ -1727,19 +1728,19 @@ (define keys
   (with-imported-modules '((guix build utils))
     #~(begin
         (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 it's a regular file: it's likely that the user manually updated
         ;; it with 'guix archive --authorize'.
-        (if (file-exists? "/etc/guix/acl")
-            (if (and (symbolic-link? "/etc/guix/acl")
-                     (store-file-name? (readlink "/etc/guix/acl")))
-                (delete-file "/etc/guix/acl")
-                (rename-file "/etc/guix/acl" "/etc/guix/acl.bak"))
-            (mkdir-p "/etc/guix"))
+        (if (file-exists? acl-file)
+            (if (and (symbolic-link? acl-file)
+                     (store-file-name? (readlink acl-file)))
+                (delete-file acl-file)
+                (rename-file acl-file (string-append acl-file ".bak")))
+            (mkdir-p (dirname acl-file)))
 
         ;; Installed the declared ACL.
-        (symlink #+default-acl "/etc/guix/acl"))))
+        (symlink #+default-acl acl-file))))
 
 (define %default-authorized-guix-keys
   ;; List of authorized substitute keys.
-- 
2.39.2





  reply	other threads:[~2023-04-24 20:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-24 19:42 [bug#63057] [PATCH core-updates 0/3] Some installer fixes Josselin Poiret via Guix-patches via
2023-04-24 19:59 ` Josselin Poiret via Guix-patches via [this message]
2023-04-24 19:59 ` [bug#63057] [PATCH core-updates 2/3] installer: Filter out C.UTF-8 from the list of locales Josselin Poiret via Guix-patches via
2023-04-24 19:59 ` [bug#63057] [PATCH core-updates 3/3] doc: Add --sysconfdir=/etc to the recommended ./configure Josselin Poiret via Guix-patches via
2023-04-30 21:12 ` bug#63057: [PATCH core-updates 0/3] Some installer fixes Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e1effe129a8561082a0cf59a84004737a9fda308.1682364024.git.dev@jpoiret.xyz \
    --to=guix-patches@gnu.org \
    --cc=63057@debbugs.gnu.org \
    --cc=dev@jpoiret.xyz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.