From: Jesse Gibbons <jgibbons2357@gmail.com>
To: Konrad Hinsen <konrad.hinsen@fastmail.net>, help-guix@gnu.org
Subject: Re: Scripting guix in guile
Date: Sat, 31 Aug 2019 11:52:44 -0600 [thread overview]
Message-ID: <4ad98823cda464db40bb57dae87d8fe666963bf3.camel@gmail.com> (raw)
In-Reply-To: <1909d3ec18a961a8d957d677e27fdcc05dd8608c.camel@gmail.com>
On Sat, 2019-08-31 at 11:38 -0600, Jesse Gibbons wrote:
> On Sat, 2019-08-31 at 19:03 +0200, Konrad Hinsen wrote:
> > Hi everyone,
> >
> > I'd like to write Guile scripts that inspect Guix, for example
> > analyze
> > the packages is my profile. That turned out to be a lot more
> > difficult
> > than I expected, and in fact I haven't found a satisfying general
> > solution yet, meaning a script that I could publish in such a way
> > that
> > any Guix user could download and run it without modification.
> >
> > The problems I see are
> >
> > 1. What to put into the #! line to locate Guile.
>
> I don't think you need a shebang to script guile.
Turns out you do.
> If you do, you could always make a guix package for the scripts, and
> that will fix everything in the patch-shebangs phase.
If you package it for guix you can use it to develop your scripts as
well.
> > 2. How to construct the load path to make sure it includes
> > Guix as installed under $HOME/.config/guix/current
>
> I think the default GUILE_LOAD_PATH includes guix. Here's the
> contents
> of mine:
> ~$ ls $GUILE_LOAD_PATH
> bytestructures git.scm gnutls guix.scm json.scm shepherd.scm
> gcrypt gnu gnutls.scm ice-9/ mcron sqlite3.scm
> git gnu.scm guix json shepherd ssh
>
> gnu/, gnu.scm, guix/, and guix.scm are all guix, and guix is not part
> of my current profile. Note also most of these are prerequisites for
> guix.
> >
> > I wonder if could somehow hijack 'guix repl', which solves these
> > problems for a REPL but not for scripts.
> >
> > Any ideas?
> >
> > Konrad
> >
>
> -You're writing tools for a package manager... try packaging those
> tools for the package manager. It will take care of them like it
> takes
> care of everything else.
> --You can wrap the executables with the environment variables you
> need
> so the executable scripts are callable from the default PATH. See
> what
> guix does with guile, mcron, and shepherd, which are mostly guile
> scripts with a little bit of native code.
next prev parent reply other threads:[~2019-08-31 17:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-31 17:03 Scripting guix in guile Konrad Hinsen
2019-08-31 17:38 ` Jesse Gibbons
2019-08-31 17:52 ` Jesse Gibbons [this message]
2019-09-01 8:15 ` Konrad Hinsen
2019-09-01 14:24 ` Jesse Gibbons
2019-09-04 10:42 ` Konrad Hinsen
2019-09-02 11:50 ` Ludovic Courtès
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=4ad98823cda464db40bb57dae87d8fe666963bf3.camel@gmail.com \
--to=jgibbons2357@gmail.com \
--cc=help-guix@gnu.org \
--cc=konrad.hinsen@fastmail.net \
/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).