-
Notifications
You must be signed in to change notification settings - Fork 0
/
model.nix
59 lines (43 loc) · 1.16 KB
/
model.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
{ lib
, stdenvNoCC
, fetchurl
, makeWrapper
, syntaxdot
}:
{
# Short name of the model. E.g.: nl-ud.
modelName
# Version of the model, typically a date. E.g.: 20200128
, version
# The hash of the model.
, hash
# Model description.
, description ? "SyntaxDot ${modelName} model"
}:
stdenvNoCC.mkDerivation rec {
inherit version;
pname = modelName;
src = fetchurl {
inherit hash;
url = let
fullName = "${modelName}-${version}";
in "https://s3.tensordot.com/syntaxdot/models/${fullName}.tar.gz";
};
outputs = [ "bin" "out" ];
propagatedBuildOutputs = [];
nativeBuildInputs = [ makeWrapper ];
installPhase = ''
install -Dm 0644 -t $out/share/syntaxdot/models/${modelName} *
mkdir -p $bin/bin
makeWrapper ${syntaxdot}/bin/syntaxdot $bin/bin/syntaxdot-annotate-${modelName} \
--add-flags annotate \
--add-flags "$out/share/syntaxdot/models/${modelName}/syntaxdot.conf"
'';
meta = with lib; {
inherit description;
homepage = https://github.com/tensordot/syntaxdot/;
license = licenses.unfreeRedistributable;
maintainers = with maintainers; [ danieldk ];
platforms = platforms.unix;
};
}