How to maintain a private Guix fork

This is a #LearnedTask. Scope: – customize default #guix channel; – use it in the working environment/system (i.e. “eating your own dog food”); – send patches to #guix upstream; – wait patches are merged;

I installed #guix from source code, as described here.

I'm using Stacked-Git for managing patches.

When I need to extend #guix, I search first in the contributor page if there is some open pull request to use as starting point. There can be also Guix channels in external repositories.

I create a patch, using Stacked-Git.

I test the build, using the instructions in Guix manual.

I'm using just for defining simple scripts, and nushell as scripting language. These are the scripts in justfile for system upgrade and pull:

system-upgrade:
    #!/usr/bin/env nu
    cd guix-repo
    stg branch | into string | str trim | $in == "master"
    sudo -E ./pre-inst-env guix system reconfigure /home/mzan/lavoro/admin/guix/think/config-nonguix.scm --keep-going

pull:
    #!/usr/bin/env nu
    guix pull
    cd guix-repo
    stg branch | into string | str trim | $in == "master"
    stg pull

The tricky part (i.e. not so much documented) is in sudo -E ./pre-inst-env guix system reconfigure, in particular sudo -E, for using the fork in the directory. Without -E, it will not work correctly.