nix flakes is too aggressive with caching when using things like `nix run github:...`

Created on 13 Sep 2020  路  2Comments  路  Source: NixOS/nix

Describe the bug

I need to be able to tell users that they can run the listed command.

But I really can't have much faith in which version they're getting because of the type of caching that's going on. I'm making fixes, pushing, and the command just spits out the same error. I don't see an intuitive way to bust the cast. I think it ought to be checking much more aggressively when given external references like github:.

# install nix from nixos.org/download
nix-env -iA nixpkgs.nixUnstable
nix build \
  --experimental-features 'nix-command flakes' \
  'github:colemickens/nixcfg#hosts.testipfsvm'

Expected behavior

A clear and concise description of what you expected to happen.

nix-env --version output
nix-env (Nix) 3.0pre20200829_f156513
nix (Nix) 3.0pre20200829_f156513

Additional context

Add any other context about the problem here.

bug

Most helpful comment

You can pass --refresh to force a redownload.

All 2 comments

as a workaround, add /<commit_id> to the github URL. Eg: github:colemickens/nixcfg/a00c2b2e40f8c0a483883370c44fb45c7802ca20#hosts.testipfsvm

You can pass --refresh to force a redownload.

Was this page helpful?
0 / 5 - 0 ratings