-
-
Save obadz/462444fc4fd33400ed64e75a0d409327 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ pkgs ? (import <nixpkgs> {}).pkgs | |
, stdenv ? pkgs.stdenv | |
, lib ? pkgs.lib | |
, haskell ? pkgs.haskell | |
, haskellPackages ? pkgs.haskellPackages | |
, profiling ? false | |
}: | |
rec { | |
haskellEnv = pkgs.buildEnv { | |
name = "haskell-env"; | |
paths = [ | |
(haskellPackagesUsed.ghcWithPackages (h: (haskellExtraPackages h) ++ (haskellExtraLibs h))) | |
]; | |
# Need to pin these two so that they don't get garbage collected as they are required to | |
# nix-build haskell packages | |
postBuild = let | |
pin = [ | |
pkgs.stdenv | |
(haskell.lib.overrideCabal haskellPackages.hscolour (drv: { | |
isLibrary = false; | |
doHaddock = false; | |
hyperlinkSource = false; | |
postFixup = "rm -rf $out/lib $out/share $out/nix-support"; | |
})) | |
]; | |
in "echo ${toString pin} > $out/nix-dependencies.pin"; | |
}; | |
haskellExtraPackages = h: with h; [ | |
cabal2nix | |
cabal-install | |
ghc-mod | |
# ghci-ng | |
hasktags | |
# HaRe | |
haste-compiler # haste-perch, playground | |
haste-Cabal | |
haste-cabal-install | |
hdevtools | |
hindent | |
hlint | |
# hoogle | |
# hsimport | |
# leksah | |
pointfree | |
stack | |
stylish-haskell | |
]; | |
haskellExtraLibs = h: with h; [ | |
aeson | |
aeson-pretty | |
base | |
blaze-builder | |
bytestring | |
comonad | |
containers | |
errors | |
extra | |
hmatrix | |
http-client | |
http-client-tls | |
http-types | |
HUnit | |
hxt | |
hxt-xpath | |
ipprint | |
lens | |
matrix | |
mtl | |
QuickCheck | |
random | |
roots | |
scientific | |
split | |
statistics | |
storable-complex | |
taggy | |
taggy-lens | |
tagsoup | |
text | |
time | |
transformers | |
unordered-containers | |
utf8-string | |
vector | |
wai | |
warp | |
wreq | |
xformat | |
]; | |
haskellPackagesUsed = haskellPackages.override { overrides = haskellPackageOverrides; }; | |
haskellPackageOverrides = self: super: { | |
# "hmatrix" = super.hmatrix_0_17_0_1; | |
# "vector" = super.vector_0_11_0_0; | |
# "hmatrix-gsl" = super.hmatrix-gsl_0_17_0_0; | |
# "ghc-mod" = super."ghc-mod".overrideDerivation (attrs: rec { | |
# src = pkgs.fetchFromGitHub { | |
# owner = "kazu-yamamoto"; | |
# repo = "ghc-mod"; | |
# rev = "e0044a3697b4ffa8c454c93c93711a3b1c0cc791"; | |
# sha256 = "0i9h7kq23ss5afzdavwvh7h2abg9g6hcz2rwd9xyqbmm3k6ayrl1"; | |
# }; | |
# }); | |
# "ghc-exactprint" = super."ghc-exactprint".overrideDerivation (attrs: rec { | |
# version = "0.4.1.0"; | |
# sha256 = "66346a89296d720c03a3daa442d96634a73f604c6f06e60b786698403d6c74a7"; | |
# }); | |
# "HaRe" = super."HaRe".overrideDerivation (attrs: rec { | |
# version = "0.8.2.0"; | |
# sha256 = "66346a89296d720c03a3daa442d96634a73f604c6f06e60b786698403d6c74a7"; | |
# nativeBuildInputs = (lib.filter (x: x.name != "haskell-token-utils") attrs.nativeBuildInputs) ++ super."ghc-exactprint"; | |
# }); | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In
~/.nixpkgs/config.nix
, I have:I install this thing with:
and add this to my
~/.bash_profile
:I can still use the method described here (https://gist.github.com/obadz/eeb852fef550a1fba697) to
nix-build
local, interdependent packages. My<haskell/default.nix>
now looks a lot simpler:…and
nix-build <haskell> -A project-C
still works but for day-to-day development I usecabal
like you would on any OS (with sandboxes if I need to build interdependent projects) and I no longer need to start emacs innix-shell
.