Subject: Strange bug with guix home

From: "nomike (they/them)" <[email-masked]>
Date: Fri, 18 Jul 2025 00:38:02 +0200

Hi!

I'm trying to clean up my guix home config a little and want to adopt a 
roles/profiles/models approach, so I can use it for multiple of my 
computers.

I made the example as simple as possible while still tripping the bug.

The basic structure:
There is a "home-config.scm" which imports "roles/scrooge". 
"roles/scrooge" imports both "profiles/developer-workstation" and 
"profiles/basic-workstation".
"developer-workstation" and "basic-workstation" are completely identical 
and import "roles/basic-shell-tools". "basic-shell-tools" just creates a 
list of packages, containing only "nano" as an example.

The current state is, that the line in "developer-workstation", which 
appends the list of packages from "basic-shell-tools" to it's own list, 
is commented out.

If I run =guix home reconfigure --dry-run -L "${PWD}" home-config.scm= 
it works.
Once I comment in that line in "developer-workstation" though, which i 
identical to the line in "basic-workstation", the same =guix home= 
command fails with:

#+BEGIN QUOTE
error: basic-shell-tools-packages: unbound variable
hint: Did you forget `(use-modules (modules basic-shell-tools))'?

ice-9/eval.scm:223:20: In procedure proc:
error: scrooge-packages: unbound variable
hint: Did you forget `(use-modules (roles scrooge))'?
#+END QUOTE

I've attached a .tar.bz2 file with that example. It contains a readme 
explaining how to reproduce that issue. The .tar.bz2 is initially in a 
state which works and I've included a patch file, which when applied 
moves everything to the broken state.

As mentioned in the README.org, when I use the command 
=GUILE_LOAD_PATH="${PWD}" guix home reconfigure --dry-run 
home-config.scm= instead the one above, I'm getting no error and 
everything works.

I an only assume that this is a bug in guix.

Can anyone reproduce this? And can someone who is familiar with the 
guix-home code have a look what is going on here, because I'm totally at 
a loss right now ¯\_(ツ)_/¯.

Thanks a lot

nomike