Flakes apparently being cached when using nix run

Hello all,

I’m trying to use nix run on a remotely-hosted flake, something like this:
nix run hg+http://hg.myrepo.com/myflake#myapp
When I do so, I sometimes get an error of this format:
error: getting status of '/nix/store/920wbc999aq11lfs5c4yclfxzpqirx4f-source/myapp': No such file or directory
This occurs right away and I’m fairly sure that nix is not even looking at the remote repo (which does include myapp). I only recently added myapp to the repo, so is there some way in which either the contents of this repo, or the result of this command, has been cached, and nix is still using this out-of-date cache? I’ve tried using the --no-use-registries option out of desperation, I can’t see why it would be using a registry anyway.

Thanks for any help.

Running nix-collect-garbage resolves this, but I’d still be interested to know why/how it’s happening.

see Flakes and remote repos not being updated :+1:t3:

Right, thank you, that’s exactly the same.

1 Like

I think it wouldn’t hurt Nix to add a message that this is pulled from cache because the TTL didn’t expire or something like that…

I’d agree, it’s a confusing problem to have.