aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2022-02-28 14:27:53 +0530
committerArun Isaac2022-02-28 18:11:02 +0530
commit672556e2d9ff776d293f8fcdb250d0522f42f356 (patch)
treeced07f878a7f4104bf746981949992114c59a144
parent74febb7121d5e54cd388ab4e8176c8774ffcd438 (diff)
downloadguix-forge-672556e2d9ff776d293f8fcdb250d0522f42f356.tar.gz
guix-forge-672556e2d9ff776d293f8fcdb250d0522f42f356.tar.lz
guix-forge-672556e2d9ff776d293f8fcdb250d0522f42f356.zip
forge: Do not use use-modules in with-packages.
This composes better. * forge/utils.scm (with-packages): Do not use use-modules.
-rw-r--r--forge/utils.scm15
1 files changed, 10 insertions, 5 deletions
diff --git a/forge/utils.scm b/forge/utils.scm
index f0740f0..dd980ef 100644
--- a/forge/utils.scm
+++ b/forge/utils.scm
@@ -53,13 +53,18 @@ value."
PACKAGES are available and their search path environment variables
have been set."
#~(begin
- (use-modules (ice-9 match))
;; Add a reference to the profile.
#$(profile-with-packages packages)
;; Set the environment.
- (for-each (match-lambda
- ((variable . value)
- (setenv variable value)))
- '#$(environment-with-packages packages))
+ ;; We pull out match-lambda using module-ref instead of using
+ ;; use-modules because this gexp will be substituted into other
+ ;; gexps and use-modules only works at the top-level.
+ (let-syntax ((match-lambda (macro-transformer
+ (module-ref (resolve-module '(ice-9 match))
+ 'match-lambda))))
+ (for-each (match-lambda
+ ((variable . value)
+ (setenv variable value)))
+ '#$(environment-with-packages packages)))
;; Run the provided expression.
#$exp))