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>
This commit is contained in:
Nicolas Graves 2024-04-14 01:33:04 +02:00 committed by Ludovic Courtès
parent 95435c4ece
commit 8da7f4a110
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -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 @@ (define-module (gnu home services guix)
#: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 @@ (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)))