[Nix-dev] haskell / ghc installation questions

Charles cooper.charles.m at gmail.com
Mon May 4 20:01:18 CEST 2015


Hi,
Sorry for the newbie questions but I am very confused. I am running
unstable nixos:
```
$ nixos-version
15.05pre60905.2d8cfe7 (Dingo)
```
Installing ghc via nix-env works
```
$ nix-env -i ghc
installing ‘ghc-7.8.4-wrapper’
building path(s)
‘/nix/store/ilbam5xmbrc8wjhc8j6750xvq4q2m2aq-user-environment’
created 810 symlinks in user environment
```
However when I put it in my .nixpkgs/config:
```
$ cat .nixpkgs/config.nix
{
  packageOverrides = pkgs_: with pkgs_; {
    all = with pkgs; buildEnv {
      name = "all";
      paths = [
        wget
        nmap
        bind
        w3m
        git
        nixops
        mosh
        ghc
      ];
    };
  };
}
$ nix-env -i all
replacing old ‘all’
installing ‘all’
error: cannot coerce a set to a string, at
"/nix/store/q7gp6q24qzv9i7nhvgk0sa01zgn8mqy5-nixos-15.05pre60905.2d8cfe7/nixos/nixpkgs/pkgs/build-support/trivial-builders.nix":10:14
(use ‘--show-trace’ to show detailed location information)
```
This is seriously confusing!

Further, I am having trouble understanding the namespace system:
```
$ nix-env -qaP | grep "haskellPackages.ghc "
nixos.pkgs.haskellPackages.ghc
    ghc-7.8.4-wrapper
$ nix-env -i nixos.pkgs.haskellPackages.ghc
error: selector ‘nixos.pkgs.haskellPackages.ghc’ matches no derivations
```
Same goes for nixpkgs.haskellPackages.ghc, pkgs.haskellPackages.ghc and
haskellPackages.ghc What the hell? Further, libraries like
nixos.pkgs.haskellPackages.HTTP fail to install:
```
$ nix-env -qaP | grep HTTP | grep haskell
nixos.pkgs.haskellPackages_ghc784_profiling.HTTP
    haskell-HTTP-ghc7.8.4-4000.2.18-profiling-shared
nixos.pkgs.haskellPackages.HTTP
   haskell-HTTP-ghc7.8.4-4000.2.18-shared
nixos.pkgs.haskellPackages_ghc784_no_profiling.HTTP
   haskell-HTTP-ghc7.8.4-4000.2.18-shared
$ nix-env -i HTTP
error: selector ‘HTTP’ matches no derivations
$ nix-env -i haskellPackages.HTTP
error: selector ‘haskellPackages.HTTP’ matches no derivations
$ nix-env -i pkgs.haskellPackages.HTTP
error: selector ‘pkgs.haskellPackages.HTTP’ matches no derivations
$ nix-env -i nixos.pkgs.haskellPackages.HTTP
error: selector ‘nixos.pkgs.haskellPackages.HTTP’ matches no derivations
$ nix-env -i nixpkgs.haskellPackages.HTTP
error: selector ‘nixpkgs.haskellPackages.HTTP’ matches no derivations
```

There is clearly a huge gap in my understanding. How do I get ghc in my
config, and how do I install standard haskell packages? Thanks in advance
for any and all help.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.science.uu.nl/pipermail/nix-dev/attachments/20150504/471621b0/attachment.html 


More information about the nix-dev mailing list