diff mbox series

[bug#44630] channels: Expose the default channel in %default-channel

Message ID 86ft4vh781.fsf@163.com
State Accepted
Headers show
Series [bug#44630] channels: Expose the default channel in %default-channel | expand

Checks

Context Check Description
cbaines/submitting builds success
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue

Commit Message

Zhu Zihao Nov. 27, 2020, 2:19 a.m. UTC
Sounds reasonable. Patch updated.
Ludovic Courtès writes:

> Hi,
>
> Zhu Zihao <all_but_last@163.com> skribis:
>
>> This expose the inner channel of "%default-channels", this can help user
>> to override the original guix channel with any mirror more conveniently.
>>
>> Before:
>>
>> ```
>> (channel
>>   (inherit (car %default-channels))
>>   (url "url/to/mirror"))
>> ```
>>
>> After:
>>
>> ```
>> (channel
>>   (inherit %default-channel)
>>   (url "https://mirror.guix.org.cn/git/guix"))
>> ```
>
> Hmm I understand the need here, but at the same time, the variable is
> called ‘%default-channels’ (plural) to preserve the ability to turn
> splut Guix into several channels.
>
> What could work though is your patch, except with the name
> ‘%default-guix-channel’ instead of ‘%default-channel’, which makes it
> clear that it’s just the ‘guix’ channel.
>
> Works for you?
>
> Thanks,
> Ludo’.

Comments

Ludovic Courtès Nov. 27, 2020, 9:58 a.m. UTC | #1
Hi,

Zhu Zihao <all_but_last@163.com> skribis:

> From 1548439dbcfaa89b0c03b2d30e794a4374273507 Mon Sep 17 00:00:00 2001
> From: Zhu Zihao <all_but_last@163.com>
> Date: Fri, 27 Nov 2020 10:16:29 +0800
> Subject: [PATCH] channels: Expose the default channel in %default-channel.
>
> * guix/channels(%default-guix-channel): New variable taken from the inner of
> %default-channels.
>
> (%default-channels): Refactored.

Applied, thanks!

Ludo’.
diff mbox series

Patch

From 1548439dbcfaa89b0c03b2d30e794a4374273507 Mon Sep 17 00:00:00 2001
From: Zhu Zihao <all_but_last@163.com>
Date: Fri, 27 Nov 2020 10:16:29 +0800
Subject: [PATCH] channels: Expose the default channel in %default-channel.

* guix/channels(%default-guix-channel): New variable taken from the inner of
%default-channels.

(%default-channels): Refactored.
---
 guix/channels.scm | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/guix/channels.scm b/guix/channels.scm
index 916d663e9f..0c84eed477 100644
--- a/guix/channels.scm
+++ b/guix/channels.scm
@@ -72,6 +72,7 @@ 
             openpgp-fingerprint->bytevector
             openpgp-fingerprint
 
+            %default-guix-channel
             %default-channels
             guix-channel?
 
@@ -170,13 +171,16 @@  to the corresponding bytevector."
   ;; URL of the default 'guix' channel.
   "https://git.savannah.gnu.org/git/guix.git")
 
+(define %default-guix-channel
+  (channel
+   (name 'guix)
+   (branch "master")
+   (url %default-channel-url)
+   (introduction %guix-channel-introduction)))
+
 (define %default-channels
   ;; Default list of channels.
-  (list (channel
-         (name 'guix)
-         (branch "master")
-         (url %default-channel-url)
-         (introduction %guix-channel-introduction))))
+  (list %default-guix-channel))
 
 (define (guix-channel? channel)
   "Return true if CHANNEL is the 'guix' channel."
-- 
2.29.2