help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem using multiple manifest files


From: Mikhail Kryshen
Subject: Re: Problem using multiple manifest files
Date: Mon, 22 Oct 2018 21:39:54 +0300
User-agent: Notmuch/0.28 (https://notmuchmail.org) Emacs/26.1 (x86_64-pc-linux-gnu)

Chris Marusich <address@hidden> writes:

> Mikhail Kryshen <address@hidden> writes:
>
>> (use-modules (srfi srfi-1)
>>              ((guix ui) #:select (make-user-module)))
>>
>> (define (load-manifest file)
>>   ;; Load manifest file in a fresh module with necessary imports.
>>   (let ((module (make-user-module '((guix profiles) (gnu)))))
>>     (save-module-excursion
>>      (lambda _
>>        (set-current-module module)
>>        (load (canonicalize-path file))))))
>
> Neat example!

Thanks! 

> But what is make-user-module doing, and is it necessary?

I looked into the Guix source and reproduced what "guix package -m" does
to load a manifest file.  Make-user-module procedure appear to be used
in Guix to dynamically create modules for running user code.  I could
have simply used "load" here, but then all the files would be loaded in
the same environment and could potentially interfere with each other.

-- 
Mikhail

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]