I’m curious how people approach the edit-compile-run cycle while developing software using nix.
Do you use standard language tools for this? It seems like there could be problems here if any patchelf-ing is needed as part of the build. An example would be a dotnet project that uses a nuget package containing native binaries.
Do you only ever do nix-build or nix build? It seems like there might be problems with IDE integration or debug builds this way.
Nix builds don’t exactly have the best caching, so for active development and quick iteration
I tend to just use normal compiler tools outside of a Nix build, although I likely have a
nix shell setup to handle all my development dependencies and tools.
I typically end up using
nix build near the end of the cycle, to confirm clean builds, as well as
nix flake check for test runs - spinning up a network of VMs using the nixos test infra is super handy - and the like.
But yes, during iteration normal tools tend to be just faster, and I’ve not yet had the patience to figure out file-granularity nix. IDE support is flaky too, I need to write some kind of regex for emacs’ compile mode that strips the
/nix/store one day.
Related: if anyone figures out how to make
programs.ccache.enable actually work, please tell me. I’ve spent countless times trying to reuse build artifacts.
you need to list which derivations have to use ccache