summary refs log tree commit diff
path: root/pkgs/data/fonts/victor-mono/default.nix
blob: 11d3f1d25baef8dcc9ea3f7442d91057c13ca514 (plain) (blame)
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
{ lib, fetchzip }:

let
  version = "1.5.3";
in
fetchzip {
  name = "victor-mono-${version}";
  stripRoot = false;

  # Upstream prefers we download from the website,
  # but we really insist on a more versioned resource.
  # Happily, tagged releases on github contain the same
  # file `VictorMonoAll.zip` as from the website,
  # so we extract it from the tagged release.
  # Both methods produce the same file, but this way
  # we can safely reason about what version it is.
  url = "https://github.com/rubjo/victor-mono/raw/v${version}/public/VictorMonoAll.zip";

  postFetch = ''
    mkdir -p "$out/share/fonts/"

    mv $out/OTF $out/share/fonts/opentype
    mv $out/TTF $out/share/fonts/truetype

    rm -r $out/{EOT,WOFF,WOFF2}
  '';

  sha256 = "sha256-3TGpUDBJ24NEJb00oaJAHEbjC58bSthohzqM1klVDGA=";

  meta = with lib; {
    description = "Free programming font with cursive italics and ligatures";
    homepage = "https://rubjo.github.io/victor-mono";
    license = licenses.ofl;
    maintainers = with maintainers; [ jpotier dtzWill ];
    platforms = platforms.all;
  };
}