`util-linux` vs `utillinux`

I’m confused what the difference is between utillinux and util-linux. I was trying to find out which package contains the last binary today:

❯ readlink `which last`
/nix/store/njjgnj2wiidsqc3cdrdd62sd9j8xbzp8-util-linux-2.36-bin/bin/last

Ok, so I look up the util-linux pakage on search.nixos.org:
NixOS Search
Indeed it tells me that the package is called util-linux and can be accessed via the attribute nixpkgs.util-linux.

But then when I try

❯ nix-shell --pure -p util-linux
error: undefined variable 'util-linux' at (string):1:94
(use '--show-trace' to show detailed location information)

What gives? Somehow I discovered that the correct attribute is nixpkgs.utillinux. Why is search.nixos.org wrong here? Why the discrepancy?

utillinux and util-linux are the same. The former has been renamed to the latter and hidden from the search somewhen after the release of 20.09.

So on current unstable, 21.05 and newer you should use util-linux (but utillinux will continue to work for compatibility for a while), while you have to use utillinux on any older version.

2 Likes