Skip to content

Commit

Permalink
Merge pull request #1 from athas/nix
Browse files Browse the repository at this point in the history
Add a Nix derivation for the lucky few.
  • Loading branch information
melsman authored Apr 7, 2020
2 parents dfcb1ef + f0b8d39 commit 95959af
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 95959af

Please sign in to comment.