Last active
June 16, 2018 10:39
-
-
Save Rizary/82bf44430df040f1f14eb86e286b8dab to your computer and use it in GitHub Desktop.
setup for using cabal-install as buildinputs
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
{ nixpkgs ? import <nixpkgs> {} | |
, compiler ? "ghc822" | |
}: | |
let | |
inherit (nixpkgs) pkgs; | |
newCabal = import ./nixdeps/cabal.nix; | |
haskellPackages = pkgs.haskell.packages.${compiler}; | |
modifiedHaskellPackages = haskellPackages.override { | |
overrides = newPackages: oldPackages: { | |
Cabal = newPackages.callCabal2nix "Cabal" "${newCabal}/Cabal" {}; | |
cabal-install = newPackages.callCabal2nix "cabal-install" "${newCabal}/cabal-install" {}; | |
text = newPackages.callCabal2nix "text" (import ./nixdeps/text.nix) {}; | |
parsec = newPackages.callCabal2nix "parsec" (import ./nixdeps/parsec.nix) {}; | |
hashable = newPackages.callCabal2nix "hashable" (import ./nixdeps/hashable.nix) {}; | |
HUnit = newPackages.callCabal2nix "hunit" (import ./nixdeps/hunit.nix) {}; | |
}; | |
}; | |
cabal-install = modifiedHaskellPackages.cabal-install; | |
Cabal = modifiedHaskellPackages.Cabal; | |
in | |
pkgs.stdenv.mkDerivation rec { | |
name = "abc"; | |
src = ./.; | |
buildInputs = [cabal-install]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment