nixpkgs/pkgs/development/compilers/elm/default.nix

42 lines
1.5 KiB
Nix
Raw Normal View History

{ lib, stdenv, buildEnv
, haskell, nodejs
, fetchurl, fetchpatch, makeWrapper, git }:
let
fetchElmDeps = import ./fetchElmDeps.nix { inherit stdenv lib fetchurl; };
2019-01-04 13:03:24 +00:00
hsPkgs = haskell.packages.ghc863.override {
2018-08-25 10:52:48 +00:00
overrides = self: super: with haskell.lib;
let elmPkgs = {
2018-08-25 11:01:52 +00:00
elm = overrideCabal (self.callPackage ./packages/elm.nix { }) (drv: {
2018-08-25 10:52:48 +00:00
# sadly with parallelism most of the time breaks compilation
enableParallelBuilding = false;
preConfigure = self.fetchElmDeps {
elmPackages = (import ./packages/elm-srcs.nix);
versionsDat = ./versions.dat;
};
2018-08-25 11:01:52 +00:00
buildTools = drv.buildTools or [] ++ [ makeWrapper ];
2019-01-04 13:03:24 +00:00
jailbreak = true;
2018-08-25 11:01:52 +00:00
postInstall = ''
wrapProgram $out/bin/elm \
--prefix PATH ':' ${lib.makeBinPath [ nodejs ]}
'';
2018-08-25 10:52:48 +00:00
});
/*
2018-10-03 18:41:58 +00:00
The elm-format expression is updated via a script in the https://github.com/avh4/elm-format repo:
`pacakge/nix/build.sh`
*/
2019-01-04 13:55:06 +00:00
elm-format = justStaticExecutables (doJailbreak (self.callPackage ./packages/elm-format.nix {}));
2019-01-04 13:03:24 +00:00
inherit fetchElmDeps;
2019-01-04 13:03:24 +00:00
elmVersion = elmPkgs.elm.version;
};
in elmPkgs // {
inherit elmPkgs;
2018-08-25 10:52:48 +00:00
# Needed for elm-format
indents = self.callPackage ./packages/indents.nix {};
};
};
2018-08-21 21:51:59 +00:00
in hsPkgs.elmPkgs