Closed edrex closed 3 months ago
Should be fixed in #745
Ok, I'll start testing the python impl and report back. Thanks Domen!
Let me know if it does :)
Sorry for leaving this open for so long.
This issue is with nix itself, and isn't devenv-specific. Absent a link to a proper writeup, for anyone else struggling with frequent nixpkgs index refreshes, here's what to do:
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nix.registry.nixpkgs.flake = inputs.nixpkgs;
in your system config module (nixos, hm, darwin, nix-on-droid, etc). This says "use the locked version in the current flake at build time as the system registry nixpkgs". It results in a registry entry (nix registry list
) that points at a store path, which ensures no network traffic.There is a helper nix.generateRegistryFromInputs in the flake-utils-plus module that will do this for all your system flake inputs, which is handy but I haven't implemented it yet.
Describe the bug Expected behavior: the locked index should be cached as long as the GC root is pinned. Observed:
[155.8 MiB DL] downloading 'https://github.com/NixOS/nixpkgs/archive/ae5c332cbb5827f6b1f02572496b141021de335f.zip'
after an hour.I think this is an upstream issue, maybe the one discussed in https://discourse.nixos.org/t/pinned-nixpkgs-keeps-getting-garbage-collected/12912, but as honestly this is a huge usability papercut for devenv (I'd like to use it broadly, but these frequent refetches are too much) it seems wise to track here to move towards a solution. LMK if this is a dupe or something peculiar to my nix config. My devenv.yaml looks like: