aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Graves <ngraves@ngraves.fr>2024-04-14 01:33:04 +0200
committerLudovic Courtès <ludo@gnu.org>2024-09-04 19:16:53 +0200
commit8da7f4a1103abc2abeef1ba149e6beb8b7966ab2 (patch)
tree86fe32dfb1579ef6d4d58688f57a8f1676e49013
parent95435c4ecefa1adc9e5c0d2e00daf4a55e7dea57 (diff)
downloadguix-8da7f4a1103abc2abeef1ba149e6beb8b7966ab2.tar
guix-8da7f4a1103abc2abeef1ba149e6beb8b7966ab2.tar.gz
home: services: channels: Remove duplicate channels.
* gnu/home/services/guix.scm (extend-channel-list): Add function. (home-channels-service-type)[extend]: Use extend-channel-list. Change-Id: I587207b86216f075a54b6ed0b8fa998896bbed74 Signed-off-by: Ludovic Courtès <ludo@gnu.org>
-rw-r--r--gnu/home/services/guix.scm9
1 files changed, 8 insertions, 1 deletions
diff --git a/gnu/home/services/guix.scm b/gnu/home/services/guix.scm
index 819b20b6c9..d31d3126bb 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@reilysiegel.com>
+;;; Copyright © 2024 Nicolas Graves <ngraves@ngraves.fr>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -24,6 +25,12 @@
#:use-module (srfi srfi-1)
#:export (home-channels-service-type))
+(define (extend-channel-list initial new)
+ (delete-duplicates
+ (append initial new)
+ (lambda (channel1 channel2)
+ (eq? (channel-name channel1) (channel-name channel2)))))
+
(define (channels-xdg-files channels)
`(("guix/channels.scm"
,(plain-file
@@ -37,7 +44,7 @@
(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)))