-
Notifications
You must be signed in to change notification settings - Fork 1
/
base.nix
46 lines (40 loc) · 862 Bytes
/
base.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
{
buildNpmPackage,
fetchFromGitHub,
remarshal,
ttfautohint-nox,
type ? "ttf"
}:
let
metadata = builtins.fromJSON (builtins.readFile ./metadata.json);
in
buildNpmPackage rec {
pname = "iosevka-zt";
inherit (metadata) version npmDepsHash;
src = fetchFromGitHub {
owner = "be5invis";
repo = "iosevka";
rev = "v${version}";
inherit (metadata) hash;
};
nativeBuildInputs = [
remarshal
ttfautohint-nox
];
postPatch = ''
cp -v ${./private-build-plans.toml} private-build-plans.toml
'';
enableParallelBuilding = true;
buildPhase = ''
export HOME=$TMPDIR
runHook preBuild
npm run build --no-update-notifier -- ${type}::${pname} >/dev/null
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out
cp -avL dist/${pname}/* $out
runHook postInstall
'';
}