about summary refs log tree commit diff
path: root/pkgs/data/fonts/maple-font/default.nix
blob: 15a77c2481935c09d517457f9f2b3f8f5e0910b6 (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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
{ lib
, stdenv
, unzip
, fetchurl
}:

let
  maple-font = { pname, sha256, desc }: stdenv.mkDerivation
    rec{

      inherit pname desc;
      version = "6.2";
      src = fetchurl {
        url = "https://github.com/subframe7536/Maple-font/releases/download/v${version}/${pname}.zip";
        inherit sha256;
      };

      # Work around the "unpacker appears to have produced no directories"
      # case that happens when the archive doesn't have a subdirectory.
      setSourceRoot = "sourceRoot=`pwd`";
      nativeBuildInputs = [ unzip ];
      installPhase = ''
        find . -name '*.ttf'    -exec install -Dt $out/share/fonts/truetype {} \;
      '';

      meta = with lib; {
        homepage = "https://github.com/subframe7536/Maple-font";
        description = ''
          Open source ${desc} font with round corner and ligatures for IDE and command line
        '';
        license = licenses.ofl;
        platforms = platforms.all;
        maintainers = with maintainers; [ oluceps ];
      };
    };

in
{
  Mono = maple-font {
    pname = "MapleMono";
    sha256 = "sha256-KhG0gQRnHFvpoxdcySSEYWDtOgG4xIm8X0Ua9o1aGTw=";
    desc = "monospace";
  };

  NF = maple-font {
    pname = "MapleMono-NF";
    sha256 = "sha256-Ov6AEaLy80cwrFtmKWUceI809SwBlHsQf2F86/sc/6A=";
    desc = "Nerd Font";
  };

  SC-NF = maple-font {
    pname = "MapleMono-SC-NF";
    sha256 = "sha256-bb62YGzdE9qvlyuZG7YI16gOxWC+AijlRLY8ET+q5Rg=";
    desc = "Nerd Font SC";
  };

}