diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..63b45e4 --- /dev/null +++ b/default.nix @@ -0,0 +1,34 @@ +{ pkgs ? import {}, +}: + +pkgs.stdenv.mkDerivation rec { + name = "smlpkg"; + + src = ./.; + + nativeBuildInputs = [ pkgs.mlton ]; + + checkInputs = [ pkgs.unzip ]; + + enableParallelBuilding = true; + + doCheck = true; + + # Set as an environment variable in all the phase scripts. + MLCOMP = "mlton"; + + buildPhase = '' + make all + ''; + + installPhase = '' + make install prefix=$out + ''; + + # We cannot run the pkgtests, as Nix does not allow network + # connections. + checkPhase = '' + make -C src test + ''; + +}