all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Richard Sent <richard@freakingpenguin.com>
To: 70553@debbugs.gnu.org
Subject: bug#70553: Packages built via gexp but not "installed" are not visible in containerized environments
Date: Wed, 24 Apr 2024 13:39:16 -0400	[thread overview]
Message-ID: <87mspizmm3.fsf@freakingpenguin.com> (raw)

Hi Guix!

Consider a home environment with the following configuration:

--8<---------------cut here---------------start------------->8---
(use-modules (guix gexp)
             (gnu home)
             (gnu home services shells)
             (gnu services)
             (gnu packages dns))

(home-environment
 ;; (packages `((,isc-bind "utils")))
 (services
  (list   
   (service home-bash-service-type
            (home-bash-configuration
             (aliases
              `(;; Add other aliases here
                ,@(let ((dig (file-append (gexp-input isc-bind "utils") "/bin/dig")))
                    `(("wanip"  . ,#~(string-append #$dig " @resolver4.opendns.com myip.opendns.com +short"))
                      ("wanip4" . ,#~(string-append #$dig " @resolver4.opendns.com myip.opendns.com +short -4"))
                      ("wanip6" . ,#~(string-append #$dig " @resolver1.ipv6-sandbox.opendns.com AAAA myip.opendns.com +short -6")))))))))))
--8<---------------cut here---------------end--------------->8---

When starting a container with this home environment via `$ guix home
container home.scm`, `wanip` will be successfully aliased to
`/gnu/store/...-bind-<version>-utils/bin/dig` and that package will be
built by the daemon.

However, because the container only sees a subset of /gnu/store that
contains packages registered in the profile, that path will not be
present in the container. This can be confirmed by uncommenting the
(packages) field.

I don't know the best way to resolve this, but in my opinion the fact
that Guix lets you combine package "installation" and usage in a gexp is
a great feature. This is definitely cleaner than needing to create an
entire custom service that extends both the home profile service and
home bash service. Especially if this is done multiple times. I also
think this is better than adding isc-bind to the profile and hardcoding
"dig" in .bashrc.

It would be nice if Guix was smart enough to register that store path as
belonging to the home environment and keep it visible to the container
so the behavior could be consistent between `$ guix home reconfigure`
and `$ guix home container`.

Perhaps there's a better way to determine the /gnu/store subset that
should be visible to containers besides just reading the environmnet's
profile.

I expect this crops up in a lot more places than just home environments
and home bash service. I'd hope for a more generalized solution
that solves this problem across multiple services, not specifically
home-bash-service.

-- 
Take it easy,
Richard Sent
Making my computer weirder one commit at a time.




                 reply	other threads:[~2024-04-24 17:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mspizmm3.fsf@freakingpenguin.com \
    --to=richard@freakingpenguin.com \
    --cc=70553@debbugs.gnu.org \
    /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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.