Nix and Guix in Gentoo in 2022

February 9, 2022

A new home

In 2020 sys-apps/nix and sys-apps/guix were removed from the main ::gentoo tree into their own ::nix-guix overlay: https://github.com/trofi/nix-guix-gentoo/

The move makes the installation process slightly more cumbersome than before (nix in 2017, guix in 2017): overlays are not the first thing users have to deal with.

Maciej moved setup basics out to overlay’s own readme files: https://github.com/trofi/nix-guix-gentoo/#readme. I added a standard blurb on how one enables the overlay to make it slightly easier for newcomers.

::nix-guix overlay is still safe to use on a daily basis on top of stable or unstable Gentoo system: it provides the minimum of extra packages needed to get any of both package managers running.

Please contribute :)

PSA: I personally don’t use the overlay on a regular basis as I don’t use Gentoo as my main system. Thus bugs might creep in and stay there for quite a while until I notice. Please file the issues if you notice something odd. Or just send the fixes straight away. These packages are not that complicated. We’ll try to figure something out.

I’ll try to get a minimal CI locally but it will take some time.

Some updates meanwhile

Tip of the day

The other day I found out that nixpkgs already has a script to update packages automatically to latest version available. For github based projects it’s a matter of adding one line:

passthru.updateScript = nix-update-script { attrPath = pname; }

Recent real world example is re2c: https://github.com/NixOS/nixpkgs/pull/156972

For others you can add arbitrary code to extract current version. I tried ot on poke recently: https://github.com/NixOS/nixpkgs/pull/157108

Then package update becomes trivial by running nix-update.

Enjoy!