From f0b8d39eb9e415e4a88cfe7a27a62b25830548c3 Mon Sep 17 00:00:00 2001 From: Troels Henriksen Date: Tue, 7 Apr 2020 20:09:18 +0200 Subject: [PATCH] Add a Nix derivation for the lucky few. --- default.nix | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 default.nix 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 + ''; + +}