Hi Konrad,
Just in case you hadn't thought of this yet, you can ensure that
/usr/bin/env exists on any Guix system by consing the following entry
onto the list of services under your operating-system definition.
(extra-special-file "/usr/bin/env" (file-append coreutils "/bin/env"))
Then your scripts could just use #!/usr/bin/env and work natively
on GuixSD or a foreign distribution.
Here's what the services entry looks like in my operating-system
definition as an example:
(services (cons* (extra-special-file "/usr/bin/env" (file-append coreutils
"/bin/env"))
(postgresql-service #:extension-packages (list postgis))
(service bitlbee-service-type)
(service docker-service-type)
%desktop-services))
It's one extra step to explain in your tutorial, but if any of your
students are already curious/brave enough to have installed GuixSD, they
should be capable of adding that one line to the config.scm file
(containing the operating-system definition) that they already had to
create at OS install time. Then they just run `guix system reconfigure
config.scm`, and they've got /usr/bin/env added to their system. No
reboot. No delay. Just on with the show!
YMMV,
Gary
help-guix-requ...@gnu.org writes:
> Send Help-Guix mailing list submissions to
> help-guix@gnu.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://lists.gnu.org/mailman/listinfo/help-guix
> or, via email, send a message with subject or body 'help' to
> help-guix-requ...@gnu.org
>
> You can reach the person managing the list at
> help-guix-ow...@gnu.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Help-Guix digest..."
>
>
> Today's Topics:
>
>1. Report on environment variable issues (Tirifto)
>2. Re: rust:cargo (libcurl) vs. CURL_CA_BUNDLE (David Loyall)
>3. Re: adding environment variables to /etc/config.scm
> (Jonathan Lane)
>4. Re: Report on environment variable issues (Mikhail Kryshen)
>5. Re: Scripting guix in guile (Konrad Hinsen)
>6. Re: Help defining a trivial package. (Pierre-Henry F.)
>
>
> --
>
> Message: 1
> Date: Tue, 3 Sep 2019 21:25:50 +0200
> From: Tirifto
> To: help-guix@gnu.org
> Subject: Report on environment variable issues
> Message-ID: <20190903212550.517db...@posteo.cz>
> Content-Type: text/plain; charset=UTF-8
>
> Hello!
>
> I am running Guix on Parabola GNU+Linux-libre (a libre derivative of
> Arch Linux), and have had issues with environment variables in two
> instances. I'm not asking for help, but I'm not sure if this is
> appropriate for the bug list, either, so here we go.
>
> Firstly, when running GNOME Shell (native on Parabola), I tried
> integrating it with Guix, so that applications installed with Guix
> would be visible to GNOME Shell. I tried doing this by extending the
> environment variable ‘$XDG_DATA_DIRS’, which is empty by default,
> but that made GNOME Shell crash on login.
>
> After some investigation, it turned out that GNOME Shell falls back on
> a certain default value when the variable is empty, which already
> contains paths that GNOME Shell needs to function properly. So when the
> user extends the existing value of ‘$XDG_DATA_DIRS’ with another path,
> the variable is no longer empty, so GNOME Shell never gets to fall back
> to the paths it actually needs, and crashes instead.
>
> The solution was to manually add the paths to the extension/definition.
> I used ‘/usr/local/share:/usr/share’; not sure if that's all there was
> to it, but GNOME Shell could work with it. See also this Parabola bug:
>
> https://labs.parabola.nu/issues/2388
>
> Secondly, I find that the program ‘youtube-dl’ (native on Parabola)
> doesn't work properly when I define environment variables for SSL
> Certificates as advised by the Guix manual, like so:
>
> export SSL_CERT_DIR="$HOME/.guix-profile/etc/ssl/certs"
> export SSL_CERT_FILE="$HOME/.guix-profile/etc/ssl/certs/ca-certif\
> icates.crt"
>
> youtube-dl then complains about being unable to get local issuer
> certificates. On the other hand, when the variables are undefined, Guix
> complains about certificates, for a change (e.g. when running ‘guix
> weather’).
>
> My current solution is to comment the variables out in my ~/.profile,
> and only export them in the terminal when I'm about to use Guix.
>
> I don't know if these are reliably reproducible, and whether they
> should be fixed somewhere, or just better documented, but