unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Mikhail Kryshen <mikhail@kryshen.net>
To: "Thaddäus Töppen" <thaddaeus.toeppen@gmail.com>, help-guix@gnu.org
Subject: Re: Problem using multiple manifest files
Date: Sat, 13 Oct 2018 22:52:05 +0300	[thread overview]
Message-ID: <878t3162vu.fsf@seashell.localdomain> (raw)
In-Reply-To: <CA+uB_kWYmonv+_0QJd8urWYvUDfqvRH4eJ8hW3RQYfReGvnjeQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1303 bytes --]

Thaddäus Töppen <thaddaeus.toeppen@gmail.com> 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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 658 bytes --]

  parent reply	other threads:[~2018-10-13 19:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-12 21:50 Problem using multiple manifest files Thaddäus Töppen
2018-10-13  4:08 ` Ricardo Wurmus
2018-10-13 19:52 ` Mikhail Kryshen [this message]
2018-10-15 12:10   ` Ludovic Courtès
2018-10-20 19:53   ` Chris Marusich
2018-10-22 18:39     ` Mikhail Kryshen
2018-10-23  8:07       ` Chris Marusich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878t3162vu.fsf@seashell.localdomain \
    --to=mikhail@kryshen.net \
    --cc=help-guix@gnu.org \
    --cc=thaddaeus.toeppen@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).