12 ms·
My biggest issue with Nix flakes right now is the way it integrates with Git. It insists on copying the entire repository into the Nix store (which makes all o
by lima 3y ago
My biggest issue with Nix flakes right now is the way it integrates with Git.
It insists on copying the entire repository into the Nix store (which makes all of its content world-readable!). Even if your flake.nix is in a subdirectory of a monorepo, the entire monorepo will be copied into the store every time!
- t0astbread 3y agoIsn't it the same with channels though? On my system `/nix/var/nix/profiles/per-user/root/channels/nixos` is a symlink to `/nix/store/[...]-nixos-23.05/nixos`.
- Filligree 3y agoYes, but channels are updated less often and it's very unusual to put an application git repository into one. You might have two dozen flakes in your system. You'll typically only have a single channel, if you use them.
- pushtheenvelope 3y agoah, yeah, we have a cheeky workaround for this in Devbox ;-) https://github.com/jetpack-io/devbox/blob/main/internal/impl/generate.go#L167 https://github.com/jetpack-io/devbox/blob/main/internal/impl...
- rnhmjoj 3y agoIt's a known issue but fortunately is being worked on: https://github.com/NixOS/nix/pull/6530 https://github.com/NixOS/nix/pull/6530
- tangjurine 3y agoDoesn't this still copy the repo, but just doesn't unzip it?
- hamandcheese 3y agoI think it only lazily copies files that are referenced by your nix expression. I tested this branch, and a flake-based shell launched in 3 seconds inside a large monorepo (vs 30 seconds before). I don't think it is possible to copy this repo in 3 seconds.
- takeda 3y agoI hope that helps with nixpkgs repo as this takes a lot of time whenever it is updated.
- hamandcheese 3y agoI don't think it will. There isn't any good way to incrementally fetch remote nix files, so to use nixpkgs it all has to be downloaded and unpacked.
- hamandcheese 3y agoUnless you mean when developing on the nixpkgs repo, in which case it could help.
- yakshaving_jgt 3y agoIs this still an issue when using gitignoreSrc? https://github.com/hercules-ci/gitignore.nix https://github.com/hercules-ci/gitignore.nix
- hamandcheese 3y agoFor me, yes. Even with a completely clean checkout, the repo is a few hundred megs.
- madjam002 3y agoYeah this is annoying purely from a disk space perspective too as I easily go through 200GB of disk space in a day if I'm actively working and iterating on some Nix code