unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: sirgazil <sirgazil@zoho.com>
To: "zimoun" <zimon.toutoune@gmail.com>
Cc: "Marius Bakke" <mbakke@fastmail.com>, "Guix Help" <help-guix@gnu.org>
Subject: Re: Appropriate way to use Guix API from a Guile program
Date: Fri, 22 May 2020 08:52:27 -0500	[thread overview]
Message-ID: <1723ca812e7.101981bc932946.1773075579450045222@zoho.com> (raw)
In-Reply-To: <CAJ3okZ3_=JaOoLWPK__A=-6DzRFP_sdJ+jQg8hjgVMZwLtdK+A@mail.gmail.com>

 ---- On Thu, 21 May 2020 18:02:29 -0500 zimoun <zimon.toutoune@gmail.com> wrote ----
 > 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.

Yes, the script accepts arguments.

 
 > 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.
 > :-)

Been there, done that :)

Thanks, simon.


      parent reply	other threads:[~2020-05-22 13:52 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
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 [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=1723ca812e7.101981bc932946.1773075579450045222@zoho.com \
    --to=sirgazil@zoho.com \
    --cc=help-guix@gnu.org \
    --cc=mbakke@fastmail.com \
    --cc=zimon.toutoune@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).