Cabal files can be referred to using the magic URL cabal://NAME-VERSION,
which will automatically download the file from Hackage. Alternatively, a
direct http://host/path/pkg.cabal URL can be provided, as well as a
file:///local/path/pkg.cabal URI that doesn't depend on network access.
However, if the source hash is not already in cabal2nix's cache or provided
using the --sha256 option, cabal2nix still needs to download the source
code to compute the hash, which obviously still causes network traffic. Run the
utility with --help to see the complete list of supported command line flags.

cabal2nix can also build derivations for projects from other sources than
hackage. You only need to provide an URI that points to a cabal project. The
most common usecase for this is probably to generate a derivation for a project
on the local file system: