[Nix-dev] Haskell workflow - ghc not in PATH - recommended way / documentation?
Brian McKenna
brian at brianmckenna.org
Thu Jun 23 11:38:13 CEST 2016
I think you might want to use:
nix-shell -A env
The `env` attribute creates a derivation that brings in GHC. You can
generate a shell.nix via `cabal2nix --shell` which detects if you're
in a shell and automatically uses the attribute.
On 23 June 2016 at 19:24, Marc Weber <marco-oweber at gmx.de> wrote:
> It's way too much work to keep maintaining my nixpkgs-haskell-overlay.
>
> Trying the workflow specified in the manual:
>
> 1) ./default.nix:
>
> { nixpkgs ? import <nixpkgs> {}, compiler ? "ghc7102" }:
> nixpkgs.pkgs.haskell.packages.${compiler}.callPackage ./foo.nix { }
>
>
> 2) cabal2nix . >| foo.nix
>
> 3) nix-shell --command zsh
>
> however doesn't put ghc in PATH.
>
> BTW: Cabal2nix on cabal2nix seems to fail:
>
> configureFlags: --verbose --prefix=/nix/store/qk9jk6abnqzg8dybzgiabm4p3wjmflr0-distribution-nixpkgs-1 --libdir=$prefix/lib/$compiler --libsubdir=$pkgid --with-gcc=gcc --package-db=/tmp/nix-build-distribution-nixpkgs-1.drv-0/package.conf.d --ghc-option=-optl=-Wl,-rpath=/nix/store/qk9jk6abnqzg8dybzgiabm4p3wjmflr0-distribution-nixpkgs-1/lib/ghc-7.10.2/distribution-nixpkgs-1 --enable-split-objs --disable-library-profiling --disable-executable-profiling --enable-shared --enable-library-vanilla --enable-executable-dynamic --enable-tests
> Configuring distribution-nixpkgs-1...
> Setup: At least the following dependencies are missing:
> Cabal >1.24
> builder for ‘/nix/store/9ml89qkri8fkn1bldyh446a2g6rkscjc-distribution-nixpkgs-1.drv’ failed with exit code 1
> error: build of ‘/nix/store/9ml89qkri8fkn1bldyh446a2g6rkscjc-distribution-nixpkgs-1.drv’ failed
>
>
> I'm pretty sure that I missed something obvious ..
>
> Marc Weber
> _______________________________________________
> nix-dev mailing list
> nix-dev at lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
More information about the nix-dev
mailing list