Thaddäus Töppen <[email protected]> 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)))))
(save-module-excursion
(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 '())
files))
(combined-manifest-from-files
"emacs.scm"
"xorg.scm"
"etc.scm")
----------------------------------------------------------------------
--
Mikhail
signature.asc
Description: PGP signature
