Skip to content

Commit

Permalink
haskell: add justStaticExecutables combinator
Browse files Browse the repository at this point in the history
  • Loading branch information
domenkozar committed Mar 7, 2017
1 parent e50203b commit db23fe1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkgs/development/haskell-modules/lib.nix
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,14 @@ rec {
fixupPhase = ":";
});

# link executables statically against haskell libs to reduce closure size
justStaticExecutables = drv: overrideCabal drv (drv: {
enableSharedExecutables = false;
isLibrary = false;
doHaddock = false;
postFixup = "rm -rf $out/lib $out/nix-support $out/share/doc";
});

buildFromSdist = pkg: pkgs.lib.overrideDerivation pkg (drv: {
unpackPhase = let src = sdistTarball pkg; tarname = "${pkg.pname}-${pkg.version}"; in ''
echo "Source tarball is at ${src}/${tarname}.tar.gz"
Expand Down

0 comments on commit db23fe1

Please sign in to comment.