[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#50873] [PATCH v3 2/8] guix home: import: Allow multiple modules to
From: |
Xinglu Chen |
Subject: |
[bug#50873] [PATCH v3 2/8] guix home: import: Allow multiple modules to be imported for each service. |
Date: |
Sat, 30 Oct 2021 12:42:32 +0200 |
Previously, only one module could be imported for each service, e.g., only
(gnu home-services shell) could be imported when generating the Bash service
declaration. However, for some services, multiple modules might need to be
imported in order for it to work.
* guix/scripts/home/import.scm (generate-bash-module+configuration): Rename to
...
(generate-bash-configuration+modules): ... this.
(%files-configurations-alist): Rename to ...
(%files+configurations-alist): ... this.
(modules+configurations): Rename to ...
(configurations+modules): ... this.
(manifest->code): Adjust accordingly.
---
guix/scripts/home/import.scm | 34 +++++++++++++++++++---------------
1 file changed, 19 insertions(+), 15 deletions(-)
diff --git a/guix/scripts/home/import.scm b/guix/scripts/home/import.scm
index c7c60e95e8..533abdbb8d 100644
--- a/guix/scripts/home/import.scm
+++ b/guix/scripts/home/import.scm
@@ -43,8 +43,7 @@ (define (destination-append path)
(let ((rc (destination-append ".bashrc"))
(profile (destination-append ".bash_profile"))
(logout (destination-append ".bash_logout")))
- `((gnu home-services bash)
- (service home-bash-service-type
+ `((service home-bash-service-type
(home-bash-configuration
,@(if (file-exists? rc)
`((bashrc
@@ -60,12 +59,15 @@ (define (destination-append path)
`((bash-logout
(list (slurp-file-gexp
(local-file ,logout)))))
- '()))))))
+ '())))
+ (gnu home-services bash))))
-(define %files-configurations-alist
- `((".bashrc" . ,generate-bash-module+configuration)
- (".bash_profile" . ,generate-bash-module+configuration)
- (".bash_logout" . ,generate-bash-module+configuration)))
+
+
+(define %files+configurations-alist
+ `((".bashrc" . ,generate-bash-configuration+modules)
+ (".bash_profile" . ,generate-bash-configuration+modules)
+ (".bash_logout" . ,generate-bash-configuration+modules)))
(define (configurations+modules destination-directory)
"Return a list of procedures which when called, generate code for a home
@@ -144,12 +146,13 @@ (define (qualified-name entry)
(let ((configurations+modules
(configurations+modules destination-directory)))
`(begin
- (use-modules (gnu home)
- (gnu packages)
- ,@(map first modules+configurations))
- ,(home-environment-template
- #:specs specs
- #:services (map second modules+configurations))))
+ (use-modules (gnu home)
+ (gnu packages)
+ (gnu services)
+ ,@(concatenate (map cdr configurations+modules)))
+ ,(home-environment-template
+ #:specs specs
+ #:services (map first configurations+modules))))
`(begin
(use-modules (gnu packages))
@@ -190,13 +193,14 @@ (define name
(use-modules (guix transformations)
(gnu home)
(gnu packages)
- ,@(map first modules+configurations))
+ (gnu services)
+ ,@(concatenate (map cdr configurations+modules)))
,@transformations
,(home-environment-template
#:packages packages
- #:services (map second modules+configurations))))
+ #:services (map first configurations+modules))))
`(begin
(use-modules (guix transformations)
(gnu packages))
--
2.33.0
- [bug#50873] [PATCH 3/7] guix home: import: Fix module name for Bash service., (continued)
- [bug#50873] [PATCH 3/7] guix home: import: Fix module name for Bash service., Xinglu Chen, 2021/10/10
- [bug#50873] [PATCH 2/7] guix home: import: Allow multiple modules to be imported for each service., Xinglu Chen, 2021/10/10
- [bug#50873] [PATCH 4/7] guix home: import: Don’t use 'slurp-file-gexp'., Xinglu Chen, 2021/10/10
- [bug#50873] [PATCH 6/7] doc: Document the ‘guix home import’ subcommand., Xinglu Chen, 2021/10/10
- [bug#50873] [PATCH 5/7] guix home: import: Delete duplicate modules when importing., Xinglu Chen, 2021/10/10
- [bug#50873] [PATCH v3 0/8] Fixes to ‘guix home import’, Xinglu Chen, 2021/10/30
- [bug#50873] [PATCH v3 1/8] guix home: import: Make the user to specify a destination directory., Xinglu Chen, 2021/10/30
- [bug#50873] [PATCH v3 6/8] doc: Document the ‘guix home import’ subcommand., Xinglu Chen, 2021/10/30
- [bug#50873] [PATCH v3 4/8] guix home: import: Don’t use 'slurp-file-gexp'., Xinglu Chen, 2021/10/30
- [bug#50873] [PATCH v3 2/8] guix home: import: Allow multiple modules to be imported for each service.,
Xinglu Chen <=
- [bug#50873] [PATCH v3 3/8] guix home: import: Fix module name for Bash service., Xinglu Chen, 2021/10/30
- [bug#50873] [PATCH v3 7/8] Add tests for ‘guix home import’., Xinglu Chen, 2021/10/30
- [bug#50873] [PATCH v3 5/8] guix home: import: Delete duplicate modules when importing., Xinglu Chen, 2021/10/30
- [bug#50873] [PATCH v3 8/8] guix home: import: Call ‘local-file’ with ‘name’, Xinglu Chen, 2021/10/30
- [bug#50873] [PATCH 0/5] Fixes to ‘guix home import’, Ludovic Courtès, 2021/10/30