I\'ve managed to install ghc with nix-env -i ghc
.
I\'d like to install a Haskell library now, how should this be done? For example the turtle
(
As an alternative Robert's answer, one can use a nix-shell
environment by creating a shell.nix
file with contents of:
{ pkgs ? import {} }:
let myGhc = pkgs.haskellPackages.ghcWithPackages (hpkgs: with hpkgs; [
turtle
]);
in
pkgs.mkShell {
buildInputs = [ myGhc ];
}
And entering this environment with nix-shell
.
Alternatively this single command nix-shell -p "haskellPackages.ghcWithPackages (pkgs: [pkgs.turtle])"
.