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