I’m running NixOS, and I would like to use the unstable channel for a single package (zathura in this case). The way I figure I could do this add the unstable channel with nix-channel (as normal user), and add the following overlay:
self: super:
let
unstable = import <unstable> {};
in {
zathura = unstable.zathura;
}
Then, I would nix-env -i zathura.
However, this command runs out of memory (all 16GB of it) and fails.
On the other hand, when I remove the overlay, something like nix run -f '<unstable>' zathura works exactly like expected, and certainly doesn’t run out of memory.
What am I doing wrong? What is the recommended way of installing a single package from the unstable channel?
After much fiddling I discovered how to break the “import cycle” by overridings the overlays attribute. Here’s an overlay that will add an unstable sub-package to your nixpkgs: