NixOS overlay notes

NixOS has a concept of overlays since a while (around 2016). The official manual has a chapter on it : Overlays.

Overlays are used to add layers in the fix-point used by Nixpkgs to compose the set of all packages.

There is two distinct element to overlays:

Define an overlay

According to the documentation, « Overlays are Nix functions which accept two arguments, conventionally called self and super, and return a set of packages ». The documentation gives an example :

self: super:

{
  boost = super.boost.override {
    python = self.python3;
  };
  rr = super.callPackage ./pkgs/rr {
    stdenv = self.stdenv_32bit;
  };
}

I used to have a personal channels on github : sbrpkgs. Let’s convert this repository to an overlay by updating the default.nix file.