Skip to content

Commit

Permalink
elmPackages: statically link haskell deps in executables
Browse files Browse the repository at this point in the history
Reduces closure size from 2.7GB to ~190MB (where most is python+nodejs)

This optimization is now possible since bin is a separate output
but we can build $lib so that other libraries can depend upon any
elm component.
  • Loading branch information
domenkozar committed Dec 13, 2017
1 parent 8751bdc commit f73e524
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkgs/development/compilers/elm/default.nix
Expand Up @@ -45,7 +45,7 @@ let
let hlib = haskell.lib;
elmRelease = import ./packages/release.nix { inherit (self) callPackage; };
elmPkgs' = elmRelease.packages;
elmPkgs = elmPkgs' // {
elmPkgs = lib.mapAttrs (name: value: hlib.disableSharedExecutables value) (elmPkgs' // {

elm-reactor = hlib.overrideCabal elmPkgs'.elm-reactor (drv: {
buildTools = drv.buildTools or [] ++ [ self.elm-make ];
Expand Down Expand Up @@ -75,7 +75,7 @@ let
elm-interface-to-json = self.callPackage ./packages/elm-interface-to-json.nix {
aeson-pretty = self.aeson-pretty_0_7_2;
};
};
});
in elmPkgs // {
inherit elmPkgs;
elmVersion = elmRelease.version;
Expand Down

0 comments on commit f73e524

Please sign in to comment.