installer: Do not include the host (guix config).

Previously, "locales.drv" would depend on the host's (guix config).
Thus, the derivation would depend on details of the user's installation.

* gnu/installer.scm (not-config?): New procedure.
(build-compiled-file): Pass it to 'source-module-closure' and use
'make-config.scm'.
This commit is contained in:
Ludovic Courtès 2020-03-22 15:51:40 +01:00
parent 363989e668
commit 99b23eabdb
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 12 additions and 2 deletions

View File

@ -61,6 +61,14 @@
(('guix 'build _ ...) #t)
(_ #f)))
(define not-config?
;; Select (guix …) and (gnu …) modules, except (guix config).
(match-lambda
(('guix 'config) #f)
(('guix _ ...) #t)
(('gnu _ ...) #t)
(_ #f)))
(define* (build-compiled-file name locale-builder)
"Return a file-like object that evalutes the gexp LOCALE-BUILDER and store
its result in the scheme file NAME. The derivation will also build a compiled
@ -75,8 +83,10 @@ version of this file."
(define builder
(with-extensions (list guile-json-3)
(with-imported-modules (source-module-closure
'((gnu installer locale)))
(with-imported-modules `(,@(source-module-closure
'((gnu installer locale))
#:select? not-config?)
((guix config) => ,(make-config.scm)))
#~(begin
(use-modules (gnu installer locale))