I want to use a flake.nix with nix develop to set up a build environment, but the build environment has no need of a source tree as I’ve already got the local tree. Is there any way to make it stop treating the current folder as a source tree and copying it into the store? My folder has tons of build artifacts in it!
I’m about to try moving the flake into an empty subdirectory and then just remembering to reference that subdirectory with nix develop instead, but that’s awkward.
@lilyball — I also use the flake-in-empty -subdirectory workaround, having accidentally exhausted disk space on /nix by unintentionally repeatedly copying 10G of unchanged source + artifacts whenever a few text files were modified.
Also, in addition to the lazy initialization issue linked above, I also think that the “settings on inputs.self” idea from Support self-fetching parameters in flake.nix · Issue #5312 · NixOS/nix · GitHub would solve this nicely, along with flake-author-controlled submodules processing among other kinds of source processing and filtering.
My first thought was “what if I remove the self arg from outputs?” which honestly, it seems like it should work because without the self arg there’s nothing to do. But trying this made it copy to the story first, and then throw an error about how self was passed but didn’t match any argument
(for context, I was using this for nix-direnv, nothing in the current directory beyond the flake itself and optionally any nix files it might import, though even that would be acceptable to turn into a flake input itself).