Look for "remote pkg installer" but it doesn't work like you think.
You share your fpkgs on your NAS, you launch the "remote_pkg_installer" on your PS4 then you instruct it via its REST API which pkg (or pkgs) do download, basically you pass the URL of your NAS and the path where to find the package using JSON via an HTTP POST...
It's all explained in the documentation.