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; 26 May 2023 11:25:36 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri May 26 07:25:36 2023
Received: from localhost ([127.0.0.1]:48993 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1q2VZg-0008Fj-Cc
	for submit <at> debbugs.gnu.org; Fri, 26 May 2023 07:25:36 -0400
Received: from mail-wr1-f51.google.com ([209.85.221.51]:39392)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <zimon.toutoune@HIDDEN>) id 1q2VZT-0008Ep-FX
 for 49610 <at> debbugs.gnu.org; Fri, 26 May 2023 07:25:35 -0400
Received: by mail-wr1-f51.google.com with SMTP id
 ffacd0b85a97d-30ad48957f5so56348f8f.1
 for <49610 <at> debbugs.gnu.org>; Fri, 26 May 2023 04:25:23 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20221208; t=1685100318; x=1687692318;
 h=content-transfer-encoding:mime-version:message-id:date:references
 :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id
 :reply-to; bh=xeNL6dY/C8VxRqASHlCaDWxXRCJ6CZcgCYZ71F2B9Tc=;
 b=jaE8+1xrRamM69B6Coqh6XL3dN2ss1QE7RRY2y3HNM60EJcIx219qbnmpZj++BEQP6
 qS/9Q7YyAb3NxAfI6jGjNIjKdFZ0/TRtnRaX8bD3DygkzAX5kPdADcrNmmIN2qbGP16Z
 Jyj99k8TmMOfjIv9T/O+R4cNdZ+e422xPu37TIA+ZBnE6BTJTB7qBE/5+k19PfMUHGx/
 K1ZhkumLsvJ9tZV3nKJWIP35lDjRN9apchRp3W1+PIFsV4claUn/6U6qxEloxawATLoR
 uTWM93h01lb7tE7XI83hDZvL84t3HlWiSAKIvVsUSoqjT0kdwnvwa2SCJbs629MV/shl
 1rJA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20221208; t=1685100318; x=1687692318;
 h=content-transfer-encoding:mime-version:message-id:date:references
 :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=xeNL6dY/C8VxRqASHlCaDWxXRCJ6CZcgCYZ71F2B9Tc=;
 b=M3pDl+JX8KcGpcIn27mDr2r81JU8qiVYatitvWbD4XyKODRY8DMEdRtymPMKbzXv1C
 xB6cBjy+yd8ZpahBLsXIQwNTBGaoLxnLZVyIxRdqwX19bznHKBoBIEzqRCRt7xqcoOVd
 /zDtdDthxIFFA8u8JPcqHY9+bD+lfddEuMhXeYD8vk6VmWCOI2rzxufwQ13PkPLEjjWb
 Gy5oOEU5FUgJWlC43SO1QxnzsDxT2md9X2K4nCYA7u7gdhXlZD8sBEHBDpsKtLWXZPP1
 q56kYiDxFRAEd3omLw4Y3Bq2MYG4vQ9zm/qQkhZmI0L/avzMQderrBTCvg5w3o24+JEN
 KVkQ==
X-Gm-Message-State: AC+VfDwJ0VQyxLojvq5xpXmKZ7xdHldYrv/9j0igVyFBIxCgITIr4x6x
 X3H6HspUF7Jedk0C51PvMtc=
X-Google-Smtp-Source: ACHHUZ77dmGtB0vHY4OTGYBtyK5o3e57aDZNAROcDfcIIv2itU2XRHYVyS1x3QhiVGuvzMbODMuu0A==
X-Received: by 2002:adf:ec44:0:b0:2fe:e605:a8cd with SMTP id
 w4-20020adfec44000000b002fee605a8cdmr917833wrn.6.1685100317843; 
 Fri, 26 May 2023 04:25:17 -0700 (PDT)
Received: from pfiuh07 ([193.48.40.241]) by smtp.gmail.com with ESMTPSA id
 h2-20020adff4c2000000b0030631f199f9sm4861861wrp.34.2023.05.26.04.25.17
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 26 May 2023 04:25:17 -0700 (PDT)
From: Simon Tournier <zimon.toutoune@HIDDEN>
To: Antero Mejr <antero@HIDDEN>, 49610 <at> debbugs.gnu.org
Subject: Re: [bug#49610] [PATCH v3] services: guix: Add channels field.
In-Reply-To: <20230525201216.16870-1-antero@HIDDEN>
References: <20210717205819.380-1-brice@HIDDEN>
 <20230525201216.16870-1-antero@HIDDEN>
Date: Fri, 26 May 2023 12:40:40 +0200
Message-ID: <87lehbtlxz.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 49610
Cc: ludo@HIDDEN
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: -1.0 (-)

Hi,

Sorry if I am missing something.  A comment about the consistency of the
manual. :-)  The section =E2=80=9CInvoking guix pull=E2=80=9D mentions:

        Specifically, @command{guix pull} downloads code from the @dfn{chan=
nels}
        (@pxref{Channels}) specified by one of the followings, in this orde=
r:

        @enumerate
        @item
        the @option{--channels} option;
        @item
        the user's @file{~/.config/guix/channels.scm} file;
        @item
        the system-wide @file{/etc/guix/channels.scm} file;
        @item
        the built-in default channels specified in the @code{%default-chann=
els}
        variable.
        @end enumerate

On jeu., 25 mai 2023 at 20:12, Antero Mejr via Guix-patches via <guix-patch=
es@HIDDEN> wrote:

> -customized by defining @dfn{channels} in the
> -@file{~/.config/guix/channels.scm} file.  A channel specifies a URL and =
branch
> +customized by defining @dfn{channels} in the @file{/etc/guix/channels.sc=
m} and
> +@file{~/.config/guix/channels.scm} files.  A channel specifies a URL and=
 branch

I find this wording confusing.  I would suggest:

--8<---------------cut here---------------start------------->8---
A channel specifies a URL and branch customized by defining
@dfn{channels} in the @file{~/.config/guix/channels.scm} file, and/or
the @file{/etc/guix/channels.scm} file and/or the built-in default
specified in the @code{%default-channels} variable.  Guix honors the
channels file in that previous order (@xref{Invoking guix pull}).
--8<---------------cut here---------------end--------------->8---

or something like that.  Keeping in mind that this part is not Guix
System specific.

WDYT?

Cheers,
simon




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; 25 May 2023 20:12:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu May 25 16:12:43 2023
Received: from localhost ([127.0.0.1]:48228 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1q2HKE-0005pi-MH
	for submit <at> debbugs.gnu.org; Thu, 25 May 2023 16:12:43 -0400
Received: from mout-p-201.mailbox.org ([80.241.56.171]:52790)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <antero@HIDDEN>) id 1q2HKB-0005pO-8J
 for 49610 <at> debbugs.gnu.org; Thu, 25 May 2023 16:12:41 -0400
Received: from smtp2.mailbox.org (smtp2.mailbox.org
 [IPv6:2001:67c:2050:b231:465::2])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest
 SHA256) (No client certificate requested)
 by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4QRzk32WzRz9snt;
 Thu, 25 May 2023 22:12:27 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org;
 s=mail20150812; t=1685045547;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:
 content-transfer-encoding:content-transfer-encoding;
 bh=t0YE/tUUnysGJ/ix8taLAdJdbn0hnsvXWk4gUgxWK3c=;
 b=O/agdFLAQhk/F9WFZn71RxoDVOYRR4abPJJbb+2HOhHv+n5huUTMSuB+cKKi4K8sn8UqVR
 zKjqKfIhA68UEuIczfUZk7r9xJdxCt/BXEElT/uYxGq2F9PQ/mdDCgizmXFfG3Sv5VoHvD
 XwJCSeW9vvytzSDMRQ/4QOmQdFUFjLd+DBd5WQm+vq4tFrrZjusMdYBpq02OXGS53E5Nqr
 iQb6K2qadrVo1+Ze9OW4kCEkwIiK7INENBkaSYIzJ56n4BHkobVTolgwnH2UFe511LGcIc
 TQwPPn8Ga/beA4msmvMiS4tRRfB4EjQpLjzsve6BjWxypmS3JJNyCaRl7XRHWw==
From: Antero Mejr <antero@HIDDEN>
To: 49610 <at> debbugs.gnu.org
Subject: [PATCH v3] services: guix: Add channels field.
Date: Thu, 25 May 2023 20:12:16 +0000
Message-Id: <20230525201216.16870-1-antero@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-MBO-RS-ID: 021eddfe7f0470a8ad1
X-MBO-RS-META: ni3zdxi47x61ssohximn7jrszttgwiww
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 49610
Cc: ludo@HIDDEN
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: -1.7 (-)

* doc/guix.texi (Channels): Specify that '/etc/guix/channels.scm'
contains channels configuration.
(Base Services): Document 'guix-configuration-channels' field.
* gnu/services/base.scm (install-channels-file): New procedure.
(%default-channels-file): New variable.
(guix-configuration): Add channels field.
(guix-activation): Use 'install-channels-file' procedure.
---
Updated v3 patch.
Changed the channels field to accept a file-like object instead of an
S-expression. I think this is more flexible because it lets users
specify a local-file rather than just an sexp.

I think this will be a unexpected/breaking change for Guix System users. If they
have /etc/guix/channels.scm customized manually, on their next 'guix system
reconfigure', it will move that file and use the channels field, unless they
modify guix-configuration.  Maybe this change should have a NEWS entry?

 doc/guix.texi         | 17 +++++++++++++++--
 gnu/services/base.scm | 44 +++++++++++++++++++++++++++++++++++++++++--
 2 files changed, 57 insertions(+), 4 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 31dc33fb97..d0367ab8c5 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -5397,8 +5397,8 @@ $ 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
-@file{~/.config/guix/channels.scm} file.  A channel specifies a URL and branch
+customized by defining @dfn{channels} in the @file{/etc/guix/channels.scm} and
+@file{~/.config/guix/channels.scm} files.  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
 to @emph{customize} and to @emph{extend} Guix, as we will see below.
@@ -18858,6 +18858,19 @@ few seconds when enough entropy is available and is only done once; you
 might want to turn it off for instance in a virtual machine that does
 not need it and where the extra boot time is a problem.
 
+@item @code{channels} (default: @code{%default-channels-file})
+File-like object containing a list of channels to be used by
+@command{guix pull}, by default.  The file-like object is symlinked to
+@file{/etc/guix/channels.scm}.
+
+@quotation Note
+When reconfiguring a system, 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 c5b06b57e8..e61bf6eac7 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -80,6 +80,7 @@ (define-module (gnu services base)
   #:use-module ((gnu build file-systems)
                 #:select (mount-flags->bit-mask
                           swap-space->flags-bit-mask))
+  #:use-module (guix channels)
   #:use-module (guix gexp)
   #:use-module (guix records)
   #:use-module (guix modules)
@@ -93,6 +94,7 @@ (define-module (gnu services base)
   #:use-module (srfi srfi-35)
   #: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
@@ -207,6 +209,7 @@ (define-module (gnu services base)
             guix-configuration-use-substitutes?
             guix-configuration-substitute-urls
             guix-configuration-generate-substitute-key?
+            guix-configuration-channels
             guix-configuration-extra-options
             guix-configuration-log-file
             guix-configuration-environment
@@ -1739,6 +1742,39 @@ (define acl-file #$%acl-file)
         ;; Installed the declared ACL.
         (symlink #+default-acl acl-file))))
 
+(define %default-channels-file
+  ;; File-like object containing the default list of channels.
+  (plain-file "channels.scm"
+              (with-output-to-string
+                (lambda _
+                  (pretty-print (map (lambda (channel)
+                                       (if (channel? channel)
+                                           (channel->code channel)
+                                           channel))
+                                     %default-channels))))))
+
+;; FIXME: Should this gexp be built before boot, like
+;; substitute-key-authorization does?
+(define (install-channels-file channels-file)
+  "Return a gexp with code to install CHANNELS-FILE, a file-like object."
+  (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")
@@ -1763,6 +1799,8 @@ (define-record-type* <guix-configuration>
                     (default %default-substitute-urls))
   (generate-substitute-key? guix-configuration-generate-substitute-key?
                             (default #t))         ;Boolean
+  (channels         guix-configuration-channels ;file-like
+                    (default %default-channels-file))
   (chroot-directories guix-configuration-chroot-directories ;list of file-like/strings
                       (default '()))
   (max-silent-time  guix-configuration-max-silent-time ;integer
@@ -1949,7 +1987,7 @@ (define (guix-accounts config)
 (define (guix-activation config)
   "Return the activation gexp for CONFIG."
   (match-record config <guix-configuration>
-    (guix generate-substitute-key? authorize-key? authorized-keys)
+    (guix generate-substitute-key? 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,
@@ -1963,7 +2001,9 @@ (define (guix-activation config)
 
         #$(if authorize-key?
               (substitute-key-authorization authorized-keys guix)
-              #~#f))))
+              #~#f)
+
+        #$(install-channels-file channels))))
 
 (define-record-type* <guix-extension>
   guix-extension make-guix-extension
-- 
2.39.2





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; 3 Jan 2022 11:32:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jan 03 06:32:44 2022
Received: from localhost ([127.0.0.1]:34278 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1n4LZz-0006JA-UT
	for submit <at> debbugs.gnu.org; Mon, 03 Jan 2022 06:32:44 -0500
Received: from hera.aquilenet.fr ([185.233.100.1]:55562)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1n4LZw-0006Is-MW
 for 49610 <at> debbugs.gnu.org; Mon, 03 Jan 2022 06:32:42 -0500
Received: from localhost (localhost [127.0.0.1])
 by hera.aquilenet.fr (Postfix) with ESMTP id B2B4A2C3;
 Mon,  3 Jan 2022 12:32:33 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at aquilenet.fr
Received: from hera.aquilenet.fr ([127.0.0.1])
 by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id KOiKNH4C6J-d; Mon,  3 Jan 2022 12:32:32 +0100 (CET)
Received: from ribbon (91-160-117-201.subs.proxad.net [91.160.117.201])
 by hera.aquilenet.fr (Postfix) with ESMTPSA id 1AF6113B;
 Mon,  3 Jan 2022 12:32:32 +0100 (CET)
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Brice Waegeneire <brice@HIDDEN>
Subject: Re: [PATCH v2] sevices: guix: Add channels field.
References: <87sg07e3kv.fsf_-_@HIDDEN>
 <20211221210042.6302-1-brice@HIDDEN>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: 14 =?utf-8?Q?Niv=C3=B4se?= an 230 de la =?utf-8?Q?R?=
 =?utf-8?Q?=C3=A9volution?=
X-PGP-Key-ID: 0x090B11993D9AEBB5
X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc
X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4  0CFB 090B 1199 3D9A EBB5
X-OS: x86_64-pc-linux-gnu
Date: Mon, 03 Jan 2022 12:32:31 +0100
In-Reply-To: <20211221210042.6302-1-brice@HIDDEN> (Brice Waegeneire's
 message of "Tue, 21 Dec 2021 22:00:42 +0100")
Message-ID: <87v8z1kqb4.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-Spamd-Bar: /
Authentication-Results: hera.aquilenet.fr;
	none
X-Rspamd-Server: hera
X-Rspamd-Queue-Id: B2B4A2C3
X-Spamd-Result: default: False [-0.10 / 15.00]; ARC_NA(0.00)[];
 RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_TWO(0.00)[2];
 FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[];
 TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain];
 FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+];
 RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[];
 MID_RHS_MATCH_FROM(0.00)[]
X-Spam-Score: 1.0 (+)
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: -0.0 (/)

Hi Brice,

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 (install-channels-file): New procedure.
>   (guix-configuration): Add channels field.
>   (guix-activation): Use 'install-channels-file' procedure.
> ---
>  doc/guix.texi         | 15 ++++++++++++++-
>  gnu/services/base.scm | 42 ++++++++++++++++++++++++++++++++++++++++--
>  2 files changed, 54 insertions(+), 3 deletions(-)
>
> I've changed the type of the new field from a list to a s-expression, I'm=
 not
> sure if it should be a G-exp instead.  The documentation of the
> 'channels' field as been updated as suggested.

It=E2=80=99s OK to keep it this way.

> Ludovic Court=C3=A8s <ludo@HIDDEN> writes:
>
>>> +;; 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: =
what are you
>> worried about?
>
> This is related to your commit 8b3ad455be7e8ace35a2eaebf7fffbb611280852, =
where
> you added pre-computation of the ACL to make =C2=AB [...] the first boot =
slightly
> faster =C2=BB.  Should this be done in this case too?

Ah no, commit 8b3ad455be7e8ace35a2eaebf7fffbb611280852 is about
pre-generating /etc/guix/acl.  In the case of /etc/guix/channels.scm,
there=E2=80=99s nothing to pre-generate though since we=E2=80=99re just dum=
ping the sexp
as-is to /etc/guix/channels.scm, so I think this comment can be safely
removed.

[...]

> +@item @code{channels} (default: @code{'(cons* %default-channels)})

I=E2=80=99d make the default #~%default-channels, no need for =E2=80=98cons=
*=E2=80=99.

> +@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 u=
p 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

=E2=80=9CWhen (=E2=80=A6) where @code{channels} is not null=E2=80=9D does n=
ot match the actual
code, does it?

Otherwise LGTM, 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 Dec 2021 21:01:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Dec 21 16:01:02 2021
Received: from localhost ([127.0.0.1]:55849 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mzmFm-00035T-Hd
	for submit <at> debbugs.gnu.org; Tue, 21 Dec 2021 16:01:02 -0500
Received: from relay4-d.mail.gandi.net ([217.70.183.196]:54043)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <brice@HIDDEN>) id 1mzmFg-00035C-DX
 for 49610 <at> debbugs.gnu.org; Tue, 21 Dec 2021 16:00:56 -0500
Received: (Authenticated sender: brice@HIDDEN)
 by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 18677E0007;
 Tue, 21 Dec 2021 21:00:45 +0000 (UTC)
From: Brice Waegeneire <brice@HIDDEN>
To: ludo@HIDDEN
Subject: [PATCH v2] sevices: guix: Add channels field.
Date: Tue, 21 Dec 2021 22:00:42 +0100
Message-Id: <20211221210042.6302-1-brice@HIDDEN>
X-Mailer: git-send-email 2.34.0
In-Reply-To: <87sg07e3kv.fsf_-_@HIDDEN>
References: <87sg07e3kv.fsf_-_@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.7 (/)
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: -1.7 (-)

* doc/guix.texi (Channels): Specify that '/etc/guix/channels.scm'
  contains channels configuration.
  (Base Services): Document 'guix-configuration-channels' field.
* gnu/services/base.scm (install-channels-file): New procedure.
  (guix-configuration): Add channels field.
  (guix-activation): Use 'install-channels-file' procedure.
---
 doc/guix.texi         | 15 ++++++++++++++-
 gnu/services/base.scm | 42 ++++++++++++++++++++++++++++++++++++++++--
 2 files changed, 54 insertions(+), 3 deletions(-)

I've changed the type of the new field from a list to a s-expression, I'm not
sure if it should be a G-exp instead.  The documentation of the
'channels' field as been updated as suggested.

Ludovic Courtès <ludo@HIDDEN> writes:

>> +;; FIXME Does this gexp should be build before boot, such as
>> +;; substitute-key-authorization does?
>
> There’s a grammatical issue :-), but also I’m not sure: what are you
> worried about?

This is related to your commit 8b3ad455be7e8ace35a2eaebf7fffbb611280852, where
you added pre-computation of the ACL to make « [...] the first boot slightly
faster ».  Should this be done in this case too?

>> +  (channels         guix-configuration-channels ;list of channels
>> +                    (default '()))
>
> I wonder if it should default to ‘%default-channels’, for consistency
> and least-surprise.  In practice, it means we’d always end up creating
> /etc/guix/channels.scm, but that’s probably OK.  (The downside is if we,
> Guix devs, choose to change ‘%default-channels’ at some point: users
> would be stuck with the value that got written to /etc.  That’s a very
> hypothetical situation though.)

Users would not have been stuck with a stale ‘%default-channels’, even with
the first version of this patch.  The issue with using a non null default
value, is the absence of backward compatibility.  A user with an already defined
/etc/guix/chanels.scm, would see its custom channels being replaced by the
default one after having reconfigure a system with this patch for the first
time.  So I guess I should make further adjustment to the patch

¹ <https://git.savannah.gnu.org/cgit/guix.git/commit/?id=8b3ad455be7e8ace35a2eaebf7fffbb611280852>


diff --git a/doc/guix.texi b/doc/guix.texi
index a826171f34..5284a69156 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
@@ -15557,6 +15557,19 @@ 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{'(cons* %default-channels)})
+S-expression producing a list of channels to be used by @command{guix
+pull}, by default.  The S-exp is written to
+@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..c9823e6d55 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,39 @@ archive' public keys, with GUIX."
         ;; Installed the declared ACL.
         (symlink #+default-acl "/etc/guix/acl"))))
 
+;; FIXME Does this gexp should be built before boot, such as
+;; substitute-key-authorization does?
+(define (install-channels-file channels)
+  "Return a gexp with code to install a file with CHANNELS, a S-exp returning
+a list of channels."
+  (define channels-file
+    (plain-file "channels.scm"
+                (with-output-to-string
+                  (lambda _
+                    (pretty-print (map (lambda (channel)
+                                         (if (channel? channel)
+                                             (channel->code channel)
+                                             channel))
+                                       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 +1559,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 ;sexp
+                    (default '(cons* %default-channels)))
   (chroot-directories guix-configuration-chroot-directories ;list of file-like/strings
                       (default '()))
   (max-silent-time  guix-configuration-max-silent-time ;integer
@@ -1701,7 +1738,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,7 +1751,8 @@ proxy of 'guix-daemon'...~%")
 
         #$(if authorize-key?
               (substitute-key-authorization authorized-keys guix)
-              #~#f))))
+              #~#f)
+        #$(install-channels-file channels))))
 
 (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 49610 <at> debbugs.gnu.org:


Received: (at 49610) by debbugs.gnu.org; 1 Sep 2021 21:16:55 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 01 17:16:55 2021
Received: from localhost ([127.0.0.1]:39106 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mLXbL-00039u-0V
	for submit <at> debbugs.gnu.org; Wed, 01 Sep 2021 17:16:55 -0400
Received: from eggs.gnu.org ([209.51.188.92]:47234)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1mLXbH-00039h-6j
 for 49610 <at> debbugs.gnu.org; Wed, 01 Sep 2021 17:16:51 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:38408)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1mLXbB-0008JB-4W; Wed, 01 Sep 2021 17:16:45 -0400
Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=48824 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 1mLXbA-0002cq-SP; Wed, 01 Sep 2021 17:16:45 -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> <87sg07e3kv.fsf_-_@HIDDEN>
Date: Wed, 01 Sep 2021 23:16:43 +0200
In-Reply-To: <87sg07e3kv.fsf_-_@HIDDEN> ("Ludovic =?utf-8?Q?Court=C3=A8s?=
 =?utf-8?Q?=22's?= message of "Wed, 21 Jul 2021 23:53:36 +0200")
Message-ID: <877dg06lok.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,

Any update on this one?  :-)

Thanks in advance,
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; 4 Aug 2021 04:42:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Aug 04 00:42:48 2021
Received: from localhost ([127.0.0.1]:42105 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mB8jw-0000Sp-P9
	for submit <at> debbugs.gnu.org; Wed, 04 Aug 2021 00:42:48 -0400
Received: from relay12.mail.gandi.net ([217.70.178.232]:42325)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <brice@HIDDEN>) id 1mB8ju-0000SZ-4p
 for 49610 <at> debbugs.gnu.org; Wed, 04 Aug 2021 00:42:47 -0400
Received: (Authenticated sender: brice@HIDDEN)
 by relay12.mail.gandi.net (Postfix) with ESMTPSA id 4F9D3200002;
 Wed,  4 Aug 2021 04:42:38 +0000 (UTC)
From: Brice Waegeneire <brice@HIDDEN>
To: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@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> <87wnpje3vr.fsf_-_@HIDDEN>
Date: Wed, 04 Aug 2021 06:42:34 +0200
In-Reply-To: <87wnpje3vr.fsf_-_@HIDDEN> ("Ludovic =?utf-8?Q?Court=C3=A8s?=
 =?utf-8?Q?=22's?= message of "Wed, 21 Jul 2021 23:47:04 +0200")
Message-ID: <87eeb9izwl.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: -0.7 (/)
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: -1.7 (-)

Hello Ludo=E2=80=98,

Ludovic Court=C3=A8s <ludo@HIDDEN> writes:

> 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!

Thanks, pushed as 92605326ae909471d17b0db51504e810989989f8.

Cheers,
- Brice




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: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: Fri, 26 May 2023 11:30:02 UTC

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