Hello,
I have two short questions regarding real-world use of Nix flakes.
-
For local development, I have aUpon reviewing the documentation there’s a devShell attribute that can be used for this and seems to do what I intendshell.nix
file with the libraries my C++ application depends on, along with supplemental tools such as a LSP server, code formatter, etc. There is a separatedefault.nix
file that I use for release builds which omits these development dependencies. I have set up a Nix flake for my project, but it’s unclear to me how I would include these supplemental tools and make them available when usingnix develop
. These tools should not be part of the output file that users receive, so where in the flake do they go? -
For development, I use shared libraries for my application’s dependencies. For release, I use Nix to build a fully static binary using
pkgsMusl
. The downside of this approach is that it requires building several large dependencies from source. Is there a way to specify twoflake.nix
files, one of which can be used for development (dependencies are shared libraries) and another for the release build where everything is static?
Thank you.