srid/haskell-template

error: flake haskell-template does not provide attribute 'devShells.x86_64-linux.devShell.x86_64-linux' ...

Arsca opened this issue · 6 comments

Arsca commented

Hi,

I'm getting this error when trying to enter nix develop or run the sanity check per instructions:

$ nixos-version
21.11.337526.8b3398bc758 (Porcupine)

$ git clone https://github.com/srid/haskell-template
Cloning into 'haskell-template'...
remote: Enumerating objects: 566, done.
remote: Counting objects: 100% (181/181), done.
remote: Compressing objects: 100% (45/45), done.
remote: Total 566 (delta 147), reused 142 (delta 136), pack-reused 385
Receiving objects: 100% (566/566), 120.24 KiB | 578.00 KiB/s, done.
Resolving deltas: 100% (322/322), done.

$ cd haskell-template/

$ nix develop -i -c haskell-language-server
error: flake 'git+file:///tmp/haskell-template' does not provide attribute 'devShells.x86_64-linux.devShell.x86_64-linux', 'packages.x86_64-linux.devShell.x86_64-linux', 'legacyPackages.x86_64-linux.devShell.x86_64-linux', 'devShell.x86_64-linux' or 'defaultPackage.x86_64-linux'

$ nix develop
error: flake 'git+file:///tmp/haskell-template' does not provide attribute 'devShells.x86_64-linux.devShell.x86_64-linux', 'packages.x86_64-linux.devShell.x86_64-linux', 'legacyPackages.x86_64-linux.devShell.x86_64-linux', 'devShell.x86_64-linux' or 'defaultPackage.x86_64-linux'

$ nix run .
error: cannot find flake attribute 'git+file:///tmp/haskell-template#defaultApp.x86_64-linux'
srid commented

What's your Nix version? nix --version

Arsca commented

❯ nix --version
nix (Nix) 2.4

srid commented

That's why; can you update your Nix to the latest released version and see if that resolves it?

Older Nix doesn't support devShells.default etc. style of output attributes.

srid commented

https://nixos.org/manual/nix/stable/release-notes/rl-2.7.html


  • A number of "default" flake output attributes have been renamed. These are:

    • defaultPackage.<system>packages.<system>.default
    • defaultApps.<system>apps.<system>.default
    • defaultTemplatetemplates.default
    • defaultBundler.<system>bundlers.<system>.default
    • overlayoverlays.default
    • devShell.<system>devShells.<system>.default

    The old flake output attributes still work, but nix flake check will warn about them.

srid commented

The README also says this (>= 2.8):

image

Arsca commented

Thanks for pinpointing the issue.
Upgrading NIX per your instructions resolved it.
Currently on NIX 2.10.3/NixOS 21.11