I tried using yesod devel to spin up a development server. However stack (yesod devel calls stack) will attempt to build all (or at least a lot of the) dependencies, even if I am in a nix-shell that provides those. Running nix-build works as expected and uses the binary cache.
How can I tell stack to use the dependencies provides by Nix?
When using stack with nix I use a resolver like ghc-8.6.5. This causes stack to use the package db that nix provides for you. I think there are several ways to get stack to use a particular resolver, and I am not sure what the easiest is for you (i.e. a user configured default resolver, the resolver set in a stack yaml, or the --resolver flag passed directly to stack).
I hope to give the stack-shell.nix-approach a go today. To be honest, I do not want to use stack in the first place. However yesod devel uses stack internally and I do want to use the development server provided by yesod devel.
You would use cabal2nix to generate a default.nix that enumerates your dependencies. Then you would have a shell.nix that imports that derivation. In a shell built from that shell.nix, stack with a ghc-8.6.5 resolver would find all the required dependencies in the package db nix provides for you.
I did this for a while when using intero for editor tooling which also wants to continually reload everything into a running ghci process.