From: zimoun <zimon.toutoune@gmail.com>
To: Marius Bakke <mbakke@fastmail.com>
Cc: Guix Help <help-guix@gnu.org>
Subject: Re: Appropriate way to use Guix API from a Guile program
Date: Fri, 22 May 2020 01:02:29 +0200 [thread overview]
Message-ID: <CAJ3okZ3_=JaOoLWPK__A=-6DzRFP_sdJ+jQg8hjgVMZwLtdK+A@mail.gmail.com> (raw)
In-Reply-To: <87tv0980yc.fsf@devup.no>
Dear sirgazil,
On Thu, 21 May 2020 at 22:53, Marius Bakke <mbakke@fastmail.com> wrote:
> sirgazil <sirgazil@zoho.com> writes:
> > Hmm, and is there any way for a Guile program installed as a Guix package to use the modules of the Guix obtained by the user with "guix pull" and also being able to take advantage of user-defined channels? Or is this just not possible at all?
>
> You need to add $HOME/.config/guix/current/share/guile/site/3.0 on
> GUILE_LOAD_PATH to access channel code from Guile programs.
If you feel in an experimental mood, you can try the Konrad's patch
[1]. It sets up the PATH accordingly and hides all the internals.
Well, "guix repl" launches a REPL with the current Guix modules
available and the patch extends that to scripts: "guix repl foo.scm".
Note that '--load-path' is supported so you can extend by your own
modules too. Last, command-line arguments passed to the scripts are
not supported (yet).
Well, if it is a script without command-line argument, then "guix repl
foo.scm" is the thing that you would want, I guess.
If it is a script with command-line argument, then extend
"GUILE_LOAD_PATH" by '~/.config/guix/current/share/guile/site/3.0' and
run "guile foo.scm arg1 arg2" is the thing that you would want, I
guess.
Be careful to not mix the modules from the package named 'guix' --
modules installed with "guix install guix" -- and the modules of the
current Guix -- modules under
~/.config/guix/current/share/guile/site/3.0. I did the mistake once.
:-)
[1] http://issues.guix.gnu.org/41253
Hope that helps,
simon
next prev parent reply other threads:[~2020-05-21 23:02 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-20 21:38 Appropriate way to use Guix API from a Guile program sirgazil
2020-05-21 12:31 ` Efraim Flashner
2020-05-21 12:44 ` Marius Bakke
2020-05-21 13:25 ` sirgazil
2020-05-21 20:43 ` sirgazil
2020-05-21 20:52 ` Marius Bakke
2020-05-21 22:28 ` sirgazil
2020-05-21 23:02 ` zimoun [this message]
2020-05-22 7:43 ` Konrad Hinsen
2020-05-22 8:14 ` zimoun
2020-05-26 8:25 ` Konrad Hinsen
2020-05-26 16:00 ` Konrad Hinsen
2020-05-22 8:56 ` Alex Sassmannshausen
2020-05-22 14:28 ` sirgazil
2020-05-22 13:52 ` sirgazil
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='CAJ3okZ3_=JaOoLWPK__A=-6DzRFP_sdJ+jQg8hjgVMZwLtdK+A@mail.gmail.com' \
--to=zimon.toutoune@gmail.com \
--cc=help-guix@gnu.org \
--cc=mbakke@fastmail.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).