[Top][All Lists]

[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: Sat, 13 Oct 2018 22:52:05 +0300
User-agent: Notmuch/0.27 ( Emacs/26.1 (x86_64-pc-linux-gnu)

Thaddäus Töppen <address@hidden> writes:
> Am I correct in assuming, that only one manifest file can be installed at a
> time, thus all package definitions have to be in one file (or at least
> imported into a main-package-file)?

Yes, but since manifest file is a Guile program, you can implement any
custom logic for constructing the manifest there.

Here is an example of a manifest file that loads multiple manifests and
composes them into one:

(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)))))
     (lambda _
       (set-current-module module)
       (load (canonicalize-path file))))))

(define (combined-manifest-from-files . files)
  (fold (lambda (file combined)
          (manifest-add combined
                        (manifest-entries (load-manifest file))))
        (manifest '())



Attachment: signature.asc
Description: PGP signature

reply via email to

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