I installed minimal edition of nixos on vm, and then install some pkgs like i3, firefox, code, ...
but when i want to install ghc compiler of haskell i encounter with a problem
i used ghcup from its offical site for installing haskell ecosystem it needs some requirement like python3, gcc ,...., i installed all of them,
I successfully instal the ghcup but when i want to install ghc this error happen:
checking for -ar ... no
checkinf for ar ... no
configure: error: cannot find ar in your PATH, no idea how to make a library
I installed some pkgs like binutils, but error still is there.
As of now ghcup doesn't work on NixOS. I did open an upstream issue related to that: https://gitlab.haskell.org/haskell/ghcup-hs/-/issues/174
If you want ghc to be installed on Nix, you have couple of options:
If you want a GHC version, which is not present in the nixpkgs you are using, you would have to use the revision set which has the appropriate version. There are couple of ways you can find it:
I have been mostly using the second method from above. Let's say I want GHC 8.10.4 and I can find the revision set from the search there. And once I have that, I create a
shell.nix
file like this:And then you can do the following:
Note that you can use other techniques too apart from the
nix-shell
one that has been used above.