-
-
Save MichaelXavier/bb404b3f2d4be10157ad481e36ae5c3b to your computer and use it in GitHub Desktop.
troubleshooting disabling checks, benchmarks, etc in haskell + nix
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
let | |
nixpkgs = fetchTarball { | |
# a recent-ish release, could go to master | |
url = "https://github.com/NixOS/nixpkgs/archive/0879595c607b66a990693972a55a27fa54eccd79.tar.gz"; | |
sha256 = "0f8nfccabsp7qm6cjpp9m0qiwckzrqjyjhb7vlcbzqz0657hn46j"; | |
}; | |
in | |
{ ghc ? "ghc863" | |
, pkgs ? import nixpkgs { | |
config = { | |
allowUnfree = true; # allow unfree internal packages | |
packageOverrides = pkgs: | |
{ | |
haskell = pkgs.haskell // { | |
packages = pkgs.haskell.packages // { | |
# by default, disable sources of build slowdown: checking (tests), benchmarking (defaults to false currently), hoogle and haddock building, and profiling | |
#TODO: this isn't working? i still see .p_o files in the output | |
"${ghc}" = pkgs.haskell.packages.${ghc}.override { | |
overrides = self: super: | |
{ | |
mkDerivation = args: super.mkDerivation (args // { | |
doCheck = false; | |
doBenchmark = false; | |
doHoogle = false; | |
doHaddock = false; | |
enableLibraryProfiling = false; | |
enableExecutableProfiling = false; | |
}); | |
}; | |
}; | |
}; | |
}; | |
}; | |
}; | |
} | |
}: | |
let | |
inherit (pkgs) lib; | |
hlib = pkgs.haskell.lib; | |
hpkgs = pkgs.haskell.packages.${ghc}.extend (self: super: | |
{ | |
my-package = self.callCabal2nix "my-package" (lib.sourceByRegex ./. [ | |
"^\\exec.*$" | |
"^.*\\.cabal$" | |
"^LICENSE$" | |
]) {}; | |
} | |
); | |
in { | |
inherit pkgs hpkgs; | |
} |
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
with import ./default.nix {}; | |
hpkgs.shellFor { | |
packages = p: | |
[ hpkgs.my-package | |
]; | |
nativeBuildInputs = | |
[ hpkgs.cabal-install | |
]; | |
# huh? | |
shellHook = '' | |
export NIX_PATH=nixpkgs=${toString pkgs.path} | |
''; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment