forked from redyf/font-flake
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
104 lines (97 loc) · 3.02 KB
/
flake.nix
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
{
description = "A flake for packaging fonts";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
# git+ssh://git@git.example.com/User/repo.git if you're using private repos
BerkeleyMono = {
url = "git+ssh://git@github.com/redyf/BerkeleyMono.git";
flake = false;
};
monolisa = {
url = "git+ssh://git@github.com/redyf/monolisa.git";
flake = false;
};
cartograph = {
url = "git+ssh://git@github.com/redyf/cartograph.git";
flake = false;
};
};
outputs =
{
self,
nixpkgs,
flake-utils,
BerkeleyMono,
monolisa,
cartograph,
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs { inherit system; };
in
{
packages = {
lilex = pkgs.stdenv.mkDerivation {
pname = "lilex";
version = "2.530";
src = pkgs.fetchurl {
url = "https://github.com/mishamyrt/Lilex/releases/download/2.530/Lilex.zip";
sha256 = "sha256-sBn8DaXj7OXHNaoEAhjTuMmUVUbS0zNZi1h7EjembEo=";
};
buildInputs = [ pkgs.unzip ];
unpackPhase = ''
unzip -j $src
'';
installPhase = ''
mkdir -p $out/share/fonts/truetype
mv *.ttf $out/share/fonts/truetype/
'';
};
sf-mono = pkgs.stdenv.mkDerivation {
pname = "SFMono-Nerd-Font-Ligaturized";
version = "1.0";
src = pkgs.fetchFromGitHub {
owner = "shaunsingh";
repo = "SFMono-Nerd-Font-Ligaturized";
rev = "dc5a3e6fcc2e16ad476b7be3c3c17c2273b260ea";
hash = "sha256-AYjKrVLISsJWXN6Cj74wXmbJtREkFDYOCRw1t2nVH2w=";
};
installPhase = ''
mkdir -p $out/share/fonts/opentype
find $src -type f -name '*.otf' -exec cp {} $out/share/fonts/opentype/ \;
'';
};
monolisa = pkgs.stdenv.mkDerivation {
pname = "Monolisa";
version = "2.012";
src = monolisa;
installPhase = ''
mkdir -p $out/share/fonts/truetype
mv *.ttf $out/share/fonts/truetype/
'';
};
cartograph = pkgs.stdenv.mkDerivation {
pname = "CartographCF";
version = "1.0";
src = cartograph;
installPhase = ''
mkdir -p $out/share/fonts/opentype
find $src -type f -name '*.otf' -exec cp {} $out/share/fonts/opentype/ \;
'';
};
berkeley = pkgs.stdenv.mkDerivation rec {
pname = "BerkeleyMono";
version = "1.001";
src = BerkeleyMono;
installPhase = ''
mkdir -p $out/share/fonts/truetype
mv *.ttf $out/share/fonts/truetype/
'';
};
};
defaultPackage = self.packages.${system}.sf-mono;
}
);
}