haskell: add justStaticExecutables combinator
commitdb23fe1581dc99253113fe06444c65b262284f28
authorDomen Kožar <domen@dev.si>
dateTue 7 Mar 2017, 18:13 (10 years ago)
parente50203b
pkgs/development/haskell-modules/lib.nix+8
@@ -76,6 +76,14 @@ rec {
7676 fixupPhase = ":";
7777 });
7878
79+ # link executables statically against haskell libs to reduce closure size
80+ justStaticExecutables = drv: overrideCabal drv (drv: {
81+ enableSharedExecutables = false;
82+ isLibrary = false;
83+ doHaddock = false;
84+ postFixup = "rm -rf $out/lib $out/nix-support $out/share/doc";
85+ });
86+
7987 buildFromSdist = pkg: pkgs.lib.overrideDerivation pkg (drv: {
8088 unpackPhase = let src = sdistTarball pkg; tarname = "${pkg.pname}-${pkg.version}"; in ''
8189 echo "Source tarball is at ${src}/${tarname}.tar.gz"