Nix-env -i runs out of memory with unstable overlay

It looks like the overlay also gets applied when importing unstable, resulting in infinite recursion. Not sure if thats true or why that is the case.

Note that in this case (since zathura is an end-user application) you don’t really need an overlay. Simply doing

{ config, pkgs, ... }:
let
  unstable = import  <unstable> {};
in
{
  environment.systemPackages = with pkgs; [
    ...
  ] ++ with unstable; [
    zathura
  ]
  ...
}

should be enough.