Subject: [bug#60112] [PATCH] website: Add post about guix shell fhs option.

From: Ludovic Courtès <[email-masked]>
Date: Thu, 05 Jan 2023 22:00:39 +0100

Hi jman,

jman <[email-masked]> skribis:

> Hello and sorry for getting into this comment thread.
>
> I have posted a few days ago a question about preserving env vars
> when creating a container with FHS emulation:
> https://lists.gnu.org/archive/html/help-guix/2023-01/msg00002.html

The ‘PATH’ environment variable, and only this one, is overridden
unconditionally when using ‘--emulate-fhs’; quoth ‘environment.scm’:

   (when emulate-fhs?
     ;; When running in a container with EMULATE-FHS?, override $PATH
     ;; (optional, but to better match FHS expectations), and generate
     ;; /etc/ld.so.cache.
     (setenv "PATH" "/bin:/usr/bin:/sbin:/usr/sbin")
     (invoke "ldconfig" "-X"))

Other variables are preserved, as in this example:

--8<---------------cut here---------------start------------->8---
$ FOO=bar guix shell -CF -E ^FOO coreutils -- env | grep FOO
FOO=bar
--8<---------------cut here---------------end--------------->8---

HTH!

Ludo’.