you can always find examples to learn from in nixpkgs git repo. If the package can build from source, look at other package with similar dependencies. If the package is binary distribution (eg closed source), follow this guide: https://nixos.wiki/wiki/Packaging/Binaries