jordanisaacs / neovim-flake

Nix flake for neovim with configuration
https://jordanisaacs.github.io/neovim-flake
MIT License
259 stars 57 forks source link

Error cannot find flake attribute #7

Closed lontivero closed 2 years ago

lontivero commented 2 years ago

Thanks for this project. I cannot make it work by following the README.

(main)> nix run .#
error: cannot find flake attribute 'git+file:///home/user/Projects/flakes/neovim-flake#defaultApp.x86_64-linux'

Is there something I can do to bypass this issue?

lontivero commented 2 years ago

Just in case I tried with an older commit too.

(main)> git checkout 6cd2dc9
Note: switching to '6cd2dc9'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 6cd2dc9 hare plugin & treesitter, declarative treesitter
((6cd2dc9f…))> nix run .#
error: NAR hash mismatch in input 'git+https://git.sr.ht/~ecmma/tree-sitter-hare?ref=master&rev=bc26a6a949f2e0d98b7bfc437d459b250900a165' (/nix/store/avl97y74w0lcbx7w691rkz05ynzgy08p-source), expected 'sha256-u8mqBVMxbaFQB6uQTcd5Cln6kRAZQ9blqa2TwPvJkUI=', got 'sha256-iPHqJA4J+PSwnk/Fcjxfhm0/NNh823qm5sbSZ1sMKOo='
(use '--show-trace' to show detailed location information)
jordanisaacs commented 2 years ago

What version of nix are you running? defaultApp.${system} suggests it is pre nix 2.7.0. The older commits weren't adhering to the the nix flake schema correctly, and I recently updated it to follow the nix 2.7.0 updated default schemas.

Would probably run if you did nix run .#nvim (specified the app rather than using the default).

Let me know if that works for you and if so I'll update the readme.

lontivero commented 2 years ago

Yes, my nix is 2.4.

I tried with nix run .#nvim but the problem is that before that I did a nix flake check and after that all commands fail with:

(main)> nix run .#nvim
error: NAR hash mismatch in input 'git+https://git.sr.ht/~sircmpwn/hare.vim?ref=master&rev=2500e389a8be4953a7618a531c6cd94bb2cd794c' (/nix/store/k2aniy95znhdsa6rh84l1v0hclv4f9rr-source), expected 'sha256-nHzcIkm2ZiqRkl+Ms6HNjjkifprYsA8geCLhpfMo9ao=', got 'sha256-mc9R4gmOCgYEuwFnNGwUtFi21EIUdga6vAdklLixX8w='
(use '--show-trace' to show detailed location information)

Anyway, it seems the problem is on my side. I need to read more. Thanks for your help.

jordanisaacs commented 2 years ago

Yep no worries. Interestingly I tried running nix flake check with 2.4 from the unstable channel and wasn't able to reproduce either the NAR hash mismatch error or the missing default error. If you get it working I am curious to know what you did.