Use lib instead of pkgs.lib

Usage of pkgs.lib may cause infinite recursion