diff mbox series

[bug#50873,5/7] guix home: import: Delete duplicate modules when importing.

Message ID 2814010aadd95c389a54922958d1f3ffedeec106.1633861021.git.public@yoctocell.xyz
State New
Headers show
Series Fixes to ‘guix home import’ | expand

Checks

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

Commit Message

Xinglu Chen Oct. 10, 2021, 10:20 a.m. UTC
Two different services might require the same module(s), so delete duplicates
when generating the ‘use-modules’ form.

* import.scm (manifest->code): Delete duplicate modules.
---
 guix/scripts/home/import.scm | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/guix/scripts/home/import.scm b/guix/scripts/home/import.scm
index 21f762f239..b892ae3dfa 100644
--- a/guix/scripts/home/import.scm
+++ b/guix/scripts/home/import.scm
@@ -145,7 +145,8 @@  (define (qualified-name entry)
               `(begin
                  (use-modules (gnu home)
                               (gnu packages)
-                              ,@(concatenate (map cdr configurations+modules)))
+                              ,@((compose delete-duplicates concatenate)
+                                 (map cdr configurations+modules)))
                  ,(home-environment-template
                    #:specs specs
                    #:services (map first configurations+modules))))
@@ -188,7 +189,8 @@  (define name
                  (use-modules (guix transformations)
                               (gnu home)
                               (gnu packages)
-                              ,@(concatenate (map cdr configurations+modules)))
+                              ,@((compose delete-duplicates concatenate)
+                                 (map cdr configurations+modules)))
 
                  ,@transformations