unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Phil Beadling <phil@beadling.co.uk>
To: help-guix <help-guix@gnu.org>
Subject: Re: Loading Channels from a file
Date: Sun, 17 Oct 2021 11:39:55 +0100	[thread overview]
Message-ID: <CAOvsyQvNEL7ZWw7kRAeKdDR+6taemtAm-5S42k0tvKUDB+kTnQ@mail.gmail.com> (raw)
In-Reply-To: <CAOvsyQvTMp5k6EF1MCpjoQ5GUosqpF6z4obqSzfQQF+NA9k=oA@mail.gmail.com>

To answer my own question somewhat see below - although I need to think a
bit more my my original approach wasn't good enough - the problem I think
it my own understanding of Guile!

On Sat, 16 Oct 2021 at 22:24, Phil Beadling <phil@beadling.co.uk> wrote:

> Hi,
>
> (define my-channels2 (call-with-input-file (option-ref options 'channel
> #f) read))
>
>
Instead of calling read on the file there is a function in (guix ui) called
"load*" which will do the heavy lifting for you:

(define my-channels
  (let ((file (option-ref options 'channel #f)))
    (load* file (make-user-module '((guix channels))))))

      reply	other threads:[~2021-10-17 10:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-16 21:24 Loading Channels from a file Phil Beadling
2021-10-17 10:39 ` Phil Beadling [this message]

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=CAOvsyQvNEL7ZWw7kRAeKdDR+6taemtAm-5S42k0tvKUDB+kTnQ@mail.gmail.com \
    --to=phil@beadling.co.uk \
    --cc=help-guix@gnu.org \
    /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).