Nix darwin not rebuilding: "error looking up directory - object not found"

I can’t rebuild from flake on nix-darwin, there seems to be an issue fetching other flakes.

I get an error like:

error: looking up directory '«github:nix-community/poetry2nix/026858e4700f0e1cc5cf4d2b9a1ae11c41ab88be?narHash=sha256-/HGpq4yVSH7tHMBnTeCNUbfLuzYLLRRtvqNzDAP1d8k%3D»/.github': object not found - no match for id (ac0f9caeea0b8caacb308c9858364557ab08029b)

The poetry2nix flake is in my configuration, however if I remove any poetry2nix references, it’ll fail on the next flake that’s used.

I suspected this was a cryptic error for a GitHub API limit, but I have added access-tokens = github.com=<token> to both my configuration.nix (under nix.extraOptions), and in /etc/nix.conf and there is no change.

For what it’s worth, the same flake builds find on NixOs (with a very similar configuration).

I’m not sure how to proceed.

Many thanks for any help.

Seems similar, you may be able to fix this by upgrading your nix version.

Hmm, I’m on 2.24.18, so I don’t think my nix-version is the issue.

Thanks for responding.

2.24.18 … doesn’t exist?

Nix has been an absolute shitshow this year, I would try with 2.18.8, 2.24.11 (not 2.24.12, since that had some regressions related to fetching flake inputs), 2.26.2, or even lix, see which one of those works.

Due to all the recent regressions I’m 99% sure it’s the nix version, especially since it works on one machine but not another.

Sorry, 2.24.12!

Okay, thank you, I will try 2.24.11. Thanks for your help.

I’ve tried with both 2-24-11 and 2-18-8.

I installed them with nix-env -iA, because I can’t rebuild my flake at the moment.

I get:

❯ nix --version
nix (Nix) 2.18.8

But the same issue persists when I try to rebuild.

EDIT: tried 2.23.4, too, the version on my NixOS machine.

For what it’s worth, I never discovered the issue, I tried numerous nix versions. In the end I had to fully install nix and start from scratch. Nix.

Definitely don’t use nix-envnix-shell -p or nix shell would’ve been better.

I mean… software has bugs sometimes, that’s unavoidable with any software. Though I forgot to mention, deleting ~/.cache/nix may have helped if it was some bug that resulted in a broken cache. In any case, good thing you were able to resolve it.

deleting ~/.cache/nix

Why didn’t I do that!? Thanks for the advice.