tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
0
fork
atom
lol
0
fork
atom
overview
issues
pulls
pipelines
i-dot-ming: 7.01 -> 8.00
linsui
3 years ago
278fd09d
2772b970
+26
-4
1 changed file
expand all
collapse all
unified
split
pkgs
data
fonts
i-dot-ming
default.nix
+26
-4
pkgs/data/fonts/i-dot-ming/default.nix
···
1
1
-
{ lib, fetchzip }:
1
1
+
{ lib, fetchurl, writeScript }:
2
2
3
3
let
4
4
-
version = "7.01";
4
4
+
version = "8.00";
5
5
in
6
6
-
fetchzip {
6
6
+
fetchurl {
7
7
name = "i.ming-${version}";
8
8
url = "https://raw.githubusercontent.com/ichitenfont/I.Ming/${version}/${version}/I.Ming-${version}.ttf";
9
9
-
sha256 = "1b2dj7spkznpkad8a0blqigj9f6ism057r0wn9wdqg5g88yp32vd";
9
9
+
hash = "sha256-JGu9H0+IdJL6QQtLwvqlFLEaJdq1JVRiqLm5zptwjyE=";
10
10
11
11
+
recursiveHash = true;
12
12
+
downloadToTemp = true;
11
13
postFetch = ''
12
14
install -DT -m444 $downloadedFile $out/share/fonts/truetype/I.Ming/I.Ming.ttf
13
15
'';
16
16
+
17
17
+
passthru = {
18
18
+
updateScript = writeScript "updater" ''
19
19
+
#!/usr/bin/env nix-shell
20
20
+
#!nix-shell -i bash -p curl gnused
21
21
+
set -e
22
22
+
version=$(curl -i -s https://github.com/ichitenfont/I.Ming/releases/latest | sed -n -E 's|^location.*releases/tag/([0-9.]+).*$|\1|p')
23
23
+
if [[ $version != ${version} ]]; then
24
24
+
tmp=$(mktemp -d)
25
25
+
curl -Lo $tmp/I.Ming.ttf https://raw.githubusercontent.com/ichitenfont/I.Ming/$version/$version/I.Ming-$version.ttf
26
26
+
install -DT -m444 $tmp/I.Ming.ttf $tmp/share/fonts/truetype/I.Ming/I.Ming.ttf
27
27
+
rm $tmp/I.Ming.ttf
28
28
+
hash=$(nix hash path --type sha256 --base32 --sri $tmp)
29
29
+
sed -i -E \
30
30
+
-e "s/version = \"[0-9.]+\"/version = \"$version\"/" \
31
31
+
-e "s|hash = \".*\"|hash = \"$hash\"|" \
32
32
+
pkgs/data/fonts/i-dot-ming/default.nix
33
33
+
fi
34
34
+
'';
35
35
+
};
14
36
15
37
meta = with lib; {
16
38
description = "An open source Pan-CJK serif typeface";