nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 mlton,
6}:
7
8stdenv.mkDerivation rec {
9 pname = "smlfmt";
10 version = "1.2.0";
11
12 src = fetchFromGitHub {
13 owner = "shwestrick";
14 repo = "smlfmt";
15 rev = "v${version}";
16 hash = "sha256-QdpEsypkCzR/OwllKFLjz3/JvzV0OlGiqXUnS7iGD5A=";
17 };
18
19 nativeBuildInputs = [ mlton ];
20
21 installPhase = ''
22 runHook preInstall
23 install -Dm755 -t $out/bin smlfmt
24 runHook postInstall
25 '';
26
27 meta = {
28 description = "Custom parser/auto-formatter for Standard ML";
29 mainProgram = "smlfmt";
30 longDescription = ''
31 A custom parser and code formatter for Standard ML, with helpful error messages.
32
33 Supports SML source files (.sml, .sig, .fun, etc.) as well as MLBasis
34 compilation files (.mlb) using MLton conventions, including MLBasis path
35 maps.
36 '';
37
38 license = lib.licenses.mit;
39 maintainers = with lib.maintainers; [ munksgaard ];
40 platforms = mlton.meta.platforms;
41 homepage = "https://github.com/shwestrick/smlfmt";
42 };
43}