nix: split entry expression into lib.nix and pkgs.nix

tests work for Linux
NOVA conversion incomplete