NixOS / nix

Nix, the purely functional package manager
https://nixos.org/
GNU Lesser General Public License v2.1
12.79k stars 1.52k forks source link

nix develop --offline doesn't work when network has issues #8808

Open Alizter opened 1 year ago

Alizter commented 1 year ago

Describe the bug

I'm not sure what exactly causes this problem so I will try to describe the situation best I can. I often use nix develop --offline to quickly jump into a dev environment. When my internet is good and I have a profile this all works fine and no networking happens (that I can immediately see). However in some cases I will have a network issue (slow internet), in those cases nix will attempt to download nixpkgs which is strange since I have a profile and --offline has been passed. It therefore seems to me that some networking is still happening in --offline mode.

4473 has recent comments that also indicate similar behaviour.

a-h commented 1 week ago

I think I understand what is happening here based on my work on internet-disconnected systems:

See https://discourse.nixos.org/t/nix-copy-doesnt-copy-everything/55464 and https://github.com/NixOS/nix/issues/6748#issuecomment-2454468400