mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-11 13:49:23 -05:00
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:
parent
95435c4ece
commit
8da7f4a110
1 changed files with 8 additions and 1 deletions
|
@ -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)))
|
||||
|
|
Loading…
Reference in a new issue