Skip to content

Commit

Permalink
Add a Nix derivation for the lucky few.
Browse files Browse the repository at this point in the history
  • Loading branch information
athas committed Apr 7, 2020
1 parent 90db35b commit f0b8d39
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{ pkgs ? import <nixpkgs> {},
}:

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
'';

}

0 comments on commit f0b8d39

Please sign in to comment.