Subject: Re: System guix masks modules from pulled 3rd-party channels

From: Rutherther <[email-masked]>
Date: Sat, 07 Jun 2025 22:00:01 +0200

Hi Tomas,

> Hi,
> 
> when system guix produced by the guix-for-channels procedure is
> installed, modules in any channel (except in the 'guix) will shadow the
> same modules acquired via `guix pull'.

Ah right, this is because GUILE_LOAD_PATH is set to
/run/current-system/... The load path will shadow everything except the
guix that cannot really be shadowed, it's treated kind of specially.
This variable is there because both guix and guile are installed to the
profile, see `guix shell guix guile --search-paths`.

I think the easiest and maybe only solution is to also add the search
path to ~/.config/guix/current. This could be done either by installing
guile into it as well, or by installing a dummy package with
GUILE_LOAD_PATH. This would have to be coded into profile made by guix pull.

Since system profile is sourced first, and ~/.config/guix/current after
it, the env var would have the ~/.config/guix/current first and
/run/current-system second. That means the modules from
~/.config/guix/current are used.

Still, if you do pull as user without some of the channels that are
available in system, those channels will still be available to you.
While that might not be preferred behavior, I am not sure there can be
something done about it. The problem is that users definitely do want
the GUILE_LOAD_PATH to be respected, for their own projects etc. ...
So it cannot just be ignored/unset. Another solution would be to
uninstall guile from the system profile, but again, that is not a good
default, so the bug would happen by default.

Regards
Rutherther