nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchurl,
5 google-fonts,
6 migu,
7 fontforge,
8 which,
9}:
10
11stdenv.mkDerivation rec {
12 pname = "ricty";
13 version = "4.1.1";
14
15 src = fetchurl {
16 url = "https://rictyfonts.github.io/files/ricty_generator-${version}.sh";
17 sha256 = "03fngb8f5hl7ifigdm5yljhs4z2x80cq8y8kna86d07ghknhzgw6";
18 };
19
20 unpackPhase = ''
21 install -m 0770 $src ricty_generator.sh
22 '';
23
24 patchPhase = ''
25 sed -i 's/fonts_directories=".*"/fonts_directories="$inconsolata $migu"/' ricty_generator.sh
26 '';
27
28 buildInputs = [
29 google-fonts
30 migu
31 fontforge
32 which
33 ];
34
35 buildPhase = ''
36 inconsolata=${google-fonts} migu=${migu} ./ricty_generator.sh auto
37 '';
38
39 installPhase = ''
40 install -m644 --target $out/share/fonts/truetype/ricty -D Ricty-*.ttf
41 '';
42
43 meta = with lib; {
44 description = "High-quality Japanese font based on Inconsolata and Migu 1M";
45 homepage = "https://rictyfonts.github.io";
46 license = licenses.unfree;
47 maintainers = [ maintainers.mikoim ];
48 };
49}