I’m running NixOS in a virtual machine and I’m having this issue running “stack”:
error: attribute ‘ghc902’ missing, at (string):1:43
(use ‘–show-trace’ to show detailed location information)
I presume this is an issue because it can’t find ghc 9.02
I ran the following nix-env -qaPA 'nixos.haskell.compiler'
(which I found on StackOverflow) and got the following result:
nixos.haskell.compiler.ghc8107 ghc-8.10.7
nixos.haskell.compiler.ghc884 ghc-8.8.4
nixos.haskell.compiler.ghc901 ghc-9.0.1
nixos.haskell.compiler.ghc921 ghc-9.2.1
nixos.haskell.compiler.ghcHEAD ghc-9.3.20211111
nixos.haskell.compiler.ghc8102Binary ghc-binary-8.10.2
nixos.haskell.compiler.ghc8102BinaryMinimal ghc-binary-8.10.2
nixos.haskell.compiler.ghc8107Binary ghc-binary-8.10.7
nixos.haskell.compiler.ghc8107BinaryMinimal ghc-binary-8.10.7
nixos.haskell.compiler.ghc865Binary ghc-binary-8.6.5
nixos.haskell.compiler.integer-simple.ghc8107 ghc-integer-simple-8.10.7
nixos.haskell.compiler.integer-simple.ghc884 ghc-integer-simple-8.8.4
nixos.haskell.compiler.integer-simple.ghc901 ghc-integer-simple-9.0.1
nixos.haskell.compiler.integer-simple.ghc921 ghc-integer-simple-9.2.1
nixos.haskell.compiler.native-bignum.ghcHEAD ghc-native-bignum-9.3.20211111
nixos.haskell.compiler.ghcjs ghcjs-8.10.7
This seems to confirm that NixOS can’t see ghc 9.0.2, just ghc 9.0.1
But what is weird is that I have ran sudo nixos-rebuild switch --upgrade
but this makes no difference.
What makes it even more confusing when I search on Nix packages on the website https://search.nixos.org/packages?channel=unstable&from=0&size=50&sort=relevance&type=packages&query=haskell.compiler I only find such packages in the unstable branch, not the stable branch.
I do have nixos-unstable in my nix-channels:
sudo nix-channel --list
nixos https://nixos.org/channels/nixos-21.11
nixos-unstable https://nixos.org/channels/nixos-unstable
But on the website, search, I see ghc 9.0.2, not ghc 9.0.1.
So I’m thoroughly confused. Anyone have any insights here?