Post AwCBubRW6Ye6UcXc5Q by hako@social.boiledscript.com
 (DIR) More posts by hako@social.boiledscript.com
 (DIR) Post #AwBgXJ6R1scSNB5ldg by picnoir@social.alternativebit.fr
       2025-07-16T10:02:56.497758Z
       
       0 likes, 0 repeats
       
       I've been reading https://tazj.in/blog/trying-guix.I also went in a #guix sidequest last year, and found a solution tountangle Guix from the Guix pull modules. I realize I never documentedthat publicly. Here we goThere's this popular workflow in the Nix space: using a local gitNixpkgs checkout to override your system Nixpkgs. This is super usefulwhen hacking on NixOS modules, you can iteratively load them to yourdesktop/servers. It also pretty useful when you quickly want to applya patch that is not merged upstream yet.On Guix, this is a bit tricky to do. By default, Guix itself is tyingyour system config with the different channels (guix, nonguix). Thetrick is to leverage the `pre-inst-env` script to load the local guixcheckout. I did that through a small wrapper script I run when I wantto run guix system reconfigure.Seehttps://codeberg.org/picnoir/guix-config/src/branch/master/home/bin/guix-rebuild-all#L5.This works great, however, this will rewrite the guile load path, andusing this, you won't be able to use your extra channels (likenonguix).To work around that, the trick is to wrap your channels in a inferior(seehttps://codeberg.org/picnoir/guix-config/src/branch/master/systems/framework.scm#L29)and combine them with the guix channel itself (loaded from your localcheckout).Then use the `lookup-inferior-packages` function to retrieve packagesfrom this inferiorhttps://codeberg.org/picnoir/guix-config/src/branch/master/systems/framework.scm#L81.Doing this makes hacking on Guix as I hack on NixOS. I can cherry pickpatches, apply them in my guix setup and transparently deploy them onmy host system if I need to.There's an extra accidental benefit: incremental compilation. Sincewe're evaluating Guix on a long-living repository, we don't have torebuild the channel from scratch on each pull. There's a caveatthough: incremental recompilation is somewhat buggy, I had to manuallyclean the compiled files a couple of times. The error message wassuper puzzling, took me a while to figure that out.Kudos goes to cbaines, he helped me figuring out the inferior part ofthis setup!
       
 (DIR) Post #AwCBubRW6Ye6UcXc5Q by hako@social.boiledscript.com
       2025-07-16T13:28:32.208Z
       
       1 likes, 0 repeats
       
       @picnoir@social.alternativebit.fr External channels can be added to the load paths as well!  Just note to set the load paths after using Guix' pre-inst-env script.This script can be adapted and used in any channel: https://codeberg.org/hako/Rosenthal/src/branch/trunk/pre-inst-envAnd how I use them in my configurations: https://codeberg.org/hako/Testament/src/commit/0eacd34ed6173b371115fc3cb8ee5157e4388772/pre-inst-env(without using pre-inst-env scripts)https://codeberg.org/hako/Testament/src/commit/9a8e39e32999c220f61fb4927c9893b0f5c7cb87/.envrc#guix
       
 (DIR) Post #AwCBx7YJh0mGesvFLM by picnoir@social.alternativebit.fr
       2025-07-16T15:54:42.154477Z
       
       0 likes, 0 repeats
       
       @hako Thanks! That's even better!