GNU bug report logs -
#69052
[PATCH] gnu: guix: Correct home-channels-service-type extension logic.
Previous Next
Reported by: Nicolas Graves <ngraves <at> ngraves.fr>
Date: Sun, 11 Feb 2024 13:42:02 UTC
Severity: normal
Tags: moreinfo, patch
Done: Ludovic Courtès <ludo <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your message dated Wed, 04 Sep 2024 15:35:51 +0200
with message-id <87frqfee2w.fsf <at> gnu.org>
and subject line Re: [bug#69052] [PATCH v3] gnu: guix: Correct home-channels-service-type extension logic.
has caused the debbugs.gnu.org bug report #69052,
regarding [PATCH] gnu: guix: Correct home-channels-service-type extension logic.
to be marked as done.
(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)
--
69052: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=69052
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
* gnu/home/services/guix.scm
(extend-channel-list): Add function.
(home-channels-service-type)[extend]: Use extend-channel-list.
Change-Id: I587207b86216f075a54b6ed0b8fa998896bbed74
---
gnu/home/services/guix.scm | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/gnu/home/services/guix.scm b/gnu/home/services/guix.scm
index 819b20b6c9..3702976496 100644
--- a/gnu/home/services/guix.scm
+++ b/gnu/home/services/guix.scm
@@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2022 Reily Siegel <mail <at> reilysiegel.com>
+;;; Copyright © 2024 Nicolas Graves <ngraves <at> ngraves.fr>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -24,6 +25,16 @@ (define-module (gnu home services guix)
#:use-module (srfi srfi-1)
#:export (home-channels-service-type))
+(define (extend-channel-list default new)
+ "Prepend the channels in NEW by the channels in DEFAULT if their
+channel-name is not in NEW."
+ (fold-right
+ (lambda (channel acc)
+ (if (member (channel-name channel) (map channel-name acc))
+ acc
+ (cons channel acc)))
+ new default))
+
(define (channels-xdg-files channels)
`(("guix/channels.scm"
,(plain-file
@@ -37,7 +48,7 @@ (define home-channels-service-type
(name 'home-channels)
(default-value %default-channels)
(compose concatenate)
- (extend append)
+ (extend extend-channel-list)
(extensions
(list (service-extension home-xdg-configuration-files-service-type
channels-xdg-files)))
--
2.41.0
[Message part 3 (message/rfc822, inline)]
Nicolas Graves <ngraves <at> ngraves.fr> skribis:
> * gnu/home/services/guix.scm
> (extend-channel-list): Add function.
> (home-channels-service-type)[extend]: Use extend-channel-list.
>
> Change-Id: I587207b86216f075a54b6ed0b8fa998896bbed74
Finally applied, thanks!
Ludo'.
This bug report was last modified 320 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.