3 ms·
> Flakes copy the entire directory into the nix store. This is terrible for mono-repos - and especially if it contains any large files. There is an issue about
by CuriousCosmic 3y ago
> Flakes copy the entire directory into the nix store. This is terrible for mono-repos - and especially if it contains any large files. There is an issue about making the copying of the entire directory into /nix/store lazy - though this doesn't really address the problem. It just treats some common symptoms.
Could you not just do a sparse checkout for monorepos?
https://github.com/NixOS/nixpkgs/pull/135881 https://github.com/NixOS/nixpkgs/pull/135881
- bergkvist 3y agoMy use case here is not using pkgs.fetchgit etc - but rather when developing a package locally and rebuilding it. Let's say I'm working on a huge monorepo locally, with GBs of code and data in it, most of which I want to ignore in my nix build. Let's say the files I actually care about are also not in a single subfolder. Then I can't just move the flake.nix to that subfolder either.
- CuriousCosmic 3y agoOh yeah in that case it'd be a problem. There might be a way around that but that case definitely isn't ideal. albeit you could probably sparse-checkout your repo to avoid that if you don't need all of it. definitely not ideal and I agree that until lazy file mapping, content addressed derivations, and file deduplication get implemented that the UX will be rough in some cases.