"error: flake ... has an unsupported attribute 'edition'"

I’m on NixOS (20.09); I installed flakes support by adding nix.package = pkgs.nixUnstable and nix.extraOptions = ''experimental-features = nix-command flakes''; in my /etc/nixos/configuration.nix. When I try to run a flake from “nimble” repository, I’m getting an error:

$ nix run nimble#nimterop -- --help
warning: unknown setting 'extra-sandbox-paths'
error: --- Error --------------------------------------------------------------------------------------------------------------------------------------------------------- nix
flake 'github:nix-community/flake-nimble/22e4e490b5d5ad15e78c9225022d0dc43d65af8a' has an unsupported attribute 'edition', at /nix/store/vx4zih0ainkmghglpgfh236w78mp1m3g-source/flake.nix:2:3

I tried changing: nix.package = pkgs.nixFlakes and did sudo nixos-rebuild switch, but the error seems to be still exactly the same.

What can I do to make it work? Am I doing something wrong? I tried searching on the internet, but didn’t manage to find any results that would seem related :disappointed: Any help would be appreciated! :heart:

edition used to be a (required?) attribute for flakes, but was since then removed. Some older flakes still have this attribute. It is best to file an issue or PR in the flake-nimble repo to ask that the edition attribute is removed from flake.nix.

Flakes are still in development, so occasional breakage like this is a downside of being an early adopter.

2 Likes

Awesome, thanks! Will do. I do totally understand the realities of living at the bleeding edge :wink: though I must admit, flakes seemed so polished and smooth for me during my first experiments, that it’s kinda easy to forget that they’re still in-dev :sweat_smile:

2 Likes

I fully agree. I have converted my NixOS + home-manager configuration to flakes and so far it works really well. Same for some of my software projects.

1 Like