GNU bug report logs - #49610
[PATCH 0/2] Add channels field to guix-configuration

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: Brice Waegeneire <brice@HIDDEN>; Keywords: patch; dated Sat, 17 Jul 2021 20:59:01 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.

Message received at 49610 <at> debbugs.gnu.org:


Received: (at 49610) by debbugs.gnu.org; 21 Jul 2021 21:53:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jul 21 17:53:44 2021
Received: from localhost ([127.0.0.1]:38833 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1m6K9w-0003kC-Cv
	for submit <at> debbugs.gnu.org; Wed, 21 Jul 2021 17:53:44 -0400
Received: from eggs.gnu.org ([209.51.188.92]:38238)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1m6K9v-0003k1-7p
 for 49610 <at> debbugs.gnu.org; Wed, 21 Jul 2021 17:53:43 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:35572)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1m6K9p-0007fi-IP; Wed, 21 Jul 2021 17:53:37 -0400
Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=45282 helo=ribbon)
 by fencepost.gnu.org with esmtpsa
 (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1m6K9p-0000Qj-Ai; Wed, 21 Jul 2021 17:53:37 -0400
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Brice Waegeneire <brice@HIDDEN>
Subject: Re: bug#49610: [PATCH 0/2] Add channels field to guix-configuration
References: <20210717205819.380-1-brice@HIDDEN>
 <20210717210424.1921-2-brice@HIDDEN>
Date: Wed, 21 Jul 2021 23:53:36 +0200
In-Reply-To: <20210717210424.1921-2-brice@HIDDEN> (Brice Waegeneire's
 message of "Sat, 17 Jul 2021 23:04:24 +0200")
Message-ID: <87sg07e3kv.fsf_-_@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 49610
Cc: 49610 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Brice Waegeneire <brice@HIDDEN> skribis:

> * doc/guix.texi (Channels): Specify that '/etc/guix/channels.scm'
>   contains channels configuration.
>   (Base Services): Document 'guix-configuration-channels' field.
> * gnu/services/base.scm (setup-channels): New procedure.
>   (guix-configuration): Add channels field.
>   (guix-activation): Use 'setup-channels' procedure.

[...]

> +@item @code{channels} (default: @code{'()})
> +List of system channels to use, it populates
> +@file{/etc/guix/channels.scm}.

What about:

  List of channels to be used by @command{guix pull}, by default.
  Channels listed here are written to @file{/etc/guix/channels.scm}.

?

> +;; FIXME Does this gexp should be build before boot, such as
> +;; substitute-key-authorization does?

There=E2=80=99s a grammatical issue :-), but also I=E2=80=99m not sure: wha=
t are you
worried about?

> +(define (setup-channels channels)
> +  "Return a gexp with code to setup CHANNELS, a list of channels"

Missing period.  For the name, how about =E2=80=98install-channels-file=E2=
=80=99
instead?

> +  (channels         guix-configuration-channels ;list of channels
> +                    (default '()))

I wonder if it should default to =E2=80=98%default-channels=E2=80=99, for c=
onsistency
and least-surprise.  In practice, it means we=E2=80=99d always end up creat=
ing
/etc/guix/channels.scm, but that=E2=80=99s probably OK.  (The downside is i=
f we,
Guix devs, choose to change =E2=80=98%default-channels=E2=80=99 at some poi=
nt: users
would be stuck with the value that got written to /etc.  That=E2=80=99s a v=
ery
hypothetical situation though.)

WDYT?

> +        #$(if (not (null? channels))
> +              (setup-channels channels)
>                #~#f))))

In that case, we could remove the (null? channels) special case.

Thanks,
Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#49610; Package guix-patches. Full text available.

Message received at 49610 <at> debbugs.gnu.org:


Received: (at 49610) by debbugs.gnu.org; 21 Jul 2021 21:47:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jul 21 17:47:14 2021
Received: from localhost ([127.0.0.1]:38824 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1m6K3e-0003at-Hv
	for submit <at> debbugs.gnu.org; Wed, 21 Jul 2021 17:47:14 -0400
Received: from eggs.gnu.org ([209.51.188.92]:36904)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1m6K3c-0003af-3e
 for 49610 <at> debbugs.gnu.org; Wed, 21 Jul 2021 17:47:12 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:35482)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1m6K3W-00036d-6K; Wed, 21 Jul 2021 17:47:06 -0400
Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=45280 helo=ribbon)
 by fencepost.gnu.org with esmtpsa
 (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1m6K3V-0008MC-VL; Wed, 21 Jul 2021 17:47:06 -0400
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Brice Waegeneire <brice@HIDDEN>
Subject: Re: bug#49610: [PATCH 0/2] Add channels field to guix-configuration
References: <20210717205819.380-1-brice@HIDDEN>
 <20210717210424.1921-1-brice@HIDDEN>
Date: Wed, 21 Jul 2021 23:47:04 +0200
In-Reply-To: <20210717210424.1921-1-brice@HIDDEN> (Brice Waegeneire's
 message of "Sat, 17 Jul 2021 23:04:23 +0200")
Message-ID: <87wnpje3vr.fsf_-_@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 49610
Cc: 49610 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hello,

Brice Waegeneire <brice@HIDDEN> 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=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#49610; Package guix-patches. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 17 Jul 2021 21:04:47 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jul 17 17:04:47 2021
Received: from localhost ([127.0.0.1]:54688 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1m4rUI-0007tD-Mc
	for submit <at> debbugs.gnu.org; Sat, 17 Jul 2021 17:04:47 -0400
Received: from lists.gnu.org ([209.51.188.17]:49528)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <brice@HIDDEN>) id 1m4rUC-0007sv-UL
 for submit <at> debbugs.gnu.org; Sat, 17 Jul 2021 17:04:41 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:47888)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <brice@HIDDEN>) id 1m4rUC-0001a0-Oo
 for guix-patches@HIDDEN; Sat, 17 Jul 2021 17:04:36 -0400
Received: from relay9-d.mail.gandi.net ([217.70.183.199]:57009)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <brice@HIDDEN>) id 1m4rU7-0002ep-CJ
 for guix-patches@HIDDEN; Sat, 17 Jul 2021 17:04:36 -0400
Received: (Authenticated sender: brice@HIDDEN)
 by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 68722FF803
 for <guix-patches@HIDDEN>; Sat, 17 Jul 2021 21:04:28 +0000 (UTC)
From: Brice Waegeneire <brice@HIDDEN>
To: guix-patches@HIDDEN
Subject: [PATCH 2/2] services: guix: Add channels field.
Date: Sat, 17 Jul 2021 23:04:24 +0200
Message-Id: <20210717210424.1921-2-brice@HIDDEN>
X-Mailer: git-send-email 2.32.0
In-Reply-To: <20210717205819.380-1-brice@HIDDEN>
References: <20210717205819.380-1-brice@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Received-SPF: pass client-ip=217.70.183.199; envelope-from=brice@HIDDEN;
 helo=relay9-d.mail.gandi.net
X-Spam_score_int: -25
X-Spam_score: -2.6
X-Spam_bar: --
X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.6 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.6 (--)

* doc/guix.texi (Channels): Specify that '/etc/guix/channels.scm'
  contains channels configuration.
  (Base Services): Document 'guix-configuration-channels' field.
* gnu/services/base.scm (setup-channels): New procedure.
  (guix-configuration): Add channels field.
  (guix-activation): Use 'setup-channels' procedure.
---
 doc/guix.texi         | 14 +++++++++++++-
 gnu/services/base.scm | 39 ++++++++++++++++++++++++++++++++++++++-
 2 files changed, 51 insertions(+), 2 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index cca46218f2..c930530228 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -5001,7 +5001,7 @@ $ wget -O - \
 Guix and its package collection are updated by running @command{guix pull}
 (@pxref{Invoking guix pull}).  By default @command{guix pull} downloads and
 deploys Guix itself from the official GNU@tie{}Guix repository.  This can be
-customized by defining @dfn{channels} in the
+customized by defining @dfn{channels} in @file{/etc/guix/channels.scm} and
 @file{~/.config/guix/channels.scm} file.  A channel specifies a URL and branch
 of a Git repository to be deployed, and @command{guix pull} can be instructed
 to pull from one or more channels.  In other words, channels can be used
@@ -15549,6 +15549,18 @@ This example assumes that the file @file{./guix.example.org-key.pub}
 contains the public key that @code{guix.example.org} uses to sign
 substitutes.
 
+@item @code{channels} (default: @code{'()})
+List of system channels to use, it populates
+@file{/etc/guix/channels.scm}.
+
+@quotation Note
+When booting or reconfiguring to a system where @code{channels}
+is not null, the existing @file{/etc/guix/channels.scm} file is backed up as
+@file{/etc/guix/channels.scm.bak} if it was determined to be a manually modified
+file.  This is to facilitate migration from earlier versions, which
+allowed for in-place modifications to @file{/etc/guix/channels.scm}.
+@end quotation
+
 @item @code{max-silent-time} (default: @code{0})
 @itemx @code{timeout} (default: @code{0})
 The number of seconds of silence and the number of seconds of activity,
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index e206bea5f0..db63eb540b 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -58,6 +58,7 @@
   #:use-module (gnu packages terminals)
   #:use-module ((gnu build file-systems)
                 #:select (mount-flags->bit-mask))
+  #:use-module (guix channels)
   #:use-module (guix gexp)
   #:use-module (guix records)
   #:use-module (guix modules)
@@ -66,6 +67,7 @@
   #:use-module (srfi srfi-26)
   #:use-module (ice-9 match)
   #:use-module (ice-9 format)
+  #:use-module (ice-9 pretty-print)
   #:re-export (user-processes-service-type        ;backwards compatibility
                %default-substitute-urls)
   #:export (fstab-service-type
@@ -1502,6 +1504,35 @@ archive' public keys, with GUIX."
         ;; Installed the declared ACL.
         (symlink #+default-acl "/etc/guix/acl"))))
 
+;; FIXME Does this gexp should be build before boot, such as
+;; substitute-key-authorization does?
+(define (setup-channels channels)
+  "Return a gexp with code to setup CHANNELS, a list of channels"
+  (define channels-file
+    (plain-file "channels.scm"
+                (with-output-to-string
+                  (lambda _
+                    (pretty-print (map channel->code
+                                       channels))))))
+
+  (with-imported-modules '((guix build utils))
+    #~(begin
+        (use-modules (guix build utils))
+
+        ;; If channels.scm already exists, move it out of the way. Create a
+        ;; backup if it's a regular file: it's likely that the user
+        ;; manually defined it.
+        (if (file-exists? "/etc/guix/channels.scm")
+            (if (and (symbolic-link? "/etc/guix/channels.scm")
+                     (store-file-name? (readlink "/etc/guix/channels.scm")))
+                (delete-file "/etc/guix/channels.scm")
+                (rename-file "/etc/guix/channels.scm"
+                             "/etc/guix/channels.scm.bak"))
+            (mkdir-p "/etc/guix"))
+
+        ;; Installed the declared channels.
+        (symlink #+channels-file "/etc/guix/channels.scm"))))
+
 (define %default-authorized-guix-keys
   ;; List of authorized substitute keys.
   (list (file-append guix "/share/guix/berlin.guix.gnu.org.pub")
@@ -1524,6 +1555,8 @@ archive' public keys, with GUIX."
                     (default #t))
   (substitute-urls  guix-configuration-substitute-urls ;list of strings
                     (default %default-substitute-urls))
+  (channels         guix-configuration-channels ;list of channels
+                    (default '()))
   (chroot-directories guix-configuration-chroot-directories ;list of file-like/strings
                       (default '()))
   (max-silent-time  guix-configuration-max-silent-time ;integer
@@ -1701,7 +1734,7 @@ proxy of 'guix-daemon'...~%")
 (define (guix-activation config)
   "Return the activation gexp for CONFIG."
   (match-record config <guix-configuration>
-    (guix authorize-key? authorized-keys)
+    (guix authorize-key? authorized-keys channels)
     #~(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,
@@ -1714,6 +1747,10 @@ proxy of 'guix-daemon'...~%")
 
         #$(if authorize-key?
               (substitute-key-authorization authorized-keys guix)
+              #~#f)
+
+        #$(if (not (null? channels))
+              (setup-channels channels)
               #~#f))))
 
 (define* (references-file item #:optional (name "references"))
-- 
2.32.0





Information forwarded to guix-patches@HIDDEN:
bug#49610; Package guix-patches. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 17 Jul 2021 21:04:41 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jul 17 17:04:41 2021
Received: from localhost ([127.0.0.1]:54685 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1m4rUC-0007st-91
	for submit <at> debbugs.gnu.org; Sat, 17 Jul 2021 17:04:41 -0400
Received: from lists.gnu.org ([209.51.188.17]:49522)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <brice@HIDDEN>) id 1m4rU9-0007sk-Ax
 for submit <at> debbugs.gnu.org; Sat, 17 Jul 2021 17:04:35 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:47886)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <brice@HIDDEN>) id 1m4rU9-0001We-5c
 for guix-patches@HIDDEN; Sat, 17 Jul 2021 17:04:33 -0400
Received: from relay7-d.mail.gandi.net ([217.70.183.200]:60935)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <brice@HIDDEN>) id 1m4rU7-0002eD-99
 for guix-patches@HIDDEN; Sat, 17 Jul 2021 17:04:32 -0400
Received: (Authenticated sender: brice@HIDDEN)
 by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id A948D20002
 for <guix-patches@HIDDEN>; Sat, 17 Jul 2021 21:04:26 +0000 (UTC)
From: Brice Waegeneire <brice@HIDDEN>
To: guix-patches@HIDDEN
Subject: [PATCH 1/2] services: guix: Use "match-record" in activation.
Date: Sat, 17 Jul 2021 23:04:23 +0200
Message-Id: <20210717210424.1921-1-brice@HIDDEN>
X-Mailer: git-send-email 2.32.0
In-Reply-To: <20210717205819.380-1-brice@HIDDEN>
References: <20210717205819.380-1-brice@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Received-SPF: pass client-ip=217.70.183.200; envelope-from=brice@HIDDEN;
 helo=relay7-d.mail.gandi.net
X-Spam_score_int: -25
X-Spam_score: -2.6
X-Spam_bar: --
X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7,
 RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.6 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.6 (--)

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(-)

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@HIDDEN>
 ;;; Copyright © 2019 Jan (janneke) Nieuwenhuizen <janneke@HIDDEN>
 ;;; Copyright © 2020 Florian Pelz <pelzflorian@HIDDEN>
-;;; Copyright © 2020 Brice Waegeneire <brice@HIDDEN>
+;;; Copyright © 2020, 2021 Brice Waegeneire <brice@HIDDEN>
 ;;; Copyright © 2021 qblade <qblade@HIDDEN>
 ;;; Copyright © 2021 Hui Lu <luhuins@HIDDEN>
 ;;;
@@ -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."
-- 
2.32.0





Information forwarded to guix-patches@HIDDEN:
bug#49610; Package guix-patches. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 17 Jul 2021 20:58:30 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jul 17 16:58:30 2021
Received: from localhost ([127.0.0.1]:54672 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1m4rOH-0007iM-QG
	for submit <at> debbugs.gnu.org; Sat, 17 Jul 2021 16:58:29 -0400
Received: from lists.gnu.org ([209.51.188.17]:46996)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <brice@HIDDEN>) id 1m4rOF-0007iE-Mq
 for submit <at> debbugs.gnu.org; Sat, 17 Jul 2021 16:58:28 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:46900)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <brice@HIDDEN>) id 1m4rOF-0007wc-DY
 for guix-patches@HIDDEN; Sat, 17 Jul 2021 16:58:27 -0400
Received: from relay9-d.mail.gandi.net ([217.70.183.199]:40743)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <brice@HIDDEN>) id 1m4rOD-000707-7N
 for guix-patches@HIDDEN; Sat, 17 Jul 2021 16:58:27 -0400
Received: (Authenticated sender: brice@HIDDEN)
 by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id CA86AFF803
 for <guix-patches@HIDDEN>; Sat, 17 Jul 2021 20:58:21 +0000 (UTC)
From: Brice Waegeneire <brice@HIDDEN>
To: guix-patches@HIDDEN
Subject: [PATCH 0/2] Add channels field to guix-configuration
Date: Sat, 17 Jul 2021 22:58:19 +0200
Message-Id: <20210717205819.380-1-brice@HIDDEN>
X-Mailer: git-send-email 2.32.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Received-SPF: pass client-ip=217.70.183.199; envelope-from=brice@HIDDEN;
 helo=relay9-d.mail.gandi.net
X-Spam_score_int: -25
X-Spam_score: -2.6
X-Spam_bar: --
X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.6 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.6 (--)

This patchset brings the same feature as the authorized-keys but for channels;
allowing to sepcify the default channels an operating-system uses.  Allowing
an operating-system declaration to be self-contained in regards to channels

Brice Waegeneire (2):
  services: guix: Use "match-record" in activation.
  sevices: guix: Add channels field.

 doc/guix.texi         | 14 +++++++++-
 gnu/services/base.scm | 65 +++++++++++++++++++++++++++++++++----------
 2 files changed, 64 insertions(+), 15 deletions(-)

-- 
2.32.0





Acknowledgement sent to Brice Waegeneire <brice@HIDDEN>:
New bug report received and forwarded. Copy sent to guix-patches@HIDDEN. Full text available.
Report forwarded to guix-patches@HIDDEN:
bug#49610; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Wed, 21 Jul 2021 22:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.