1{
2 lib,
3 stdenvNoCC,
4 fetchzip,
5 useVariableFont ? false,
6}:
7
8stdenvNoCC.mkDerivation (finalAttrs: {
9 pname = "cascadia-code";
10 version = "2407.24";
11
12 src = fetchzip {
13 url = "https://github.com/microsoft/cascadia-code/releases/download/v${finalAttrs.version}/CascadiaCode-${finalAttrs.version}.zip";
14 stripRoot = false;
15 hash = "sha256-bCQzGCvjSQ1TXFVC3w9VPXNtjM4h7lRvljVjX/w1TJ4=";
16 };
17
18 installPhase = ''
19 runHook preInstall
20
21 ${
22 if useVariableFont then
23 ''
24 install -Dm644 ttf/*.ttf -t $out/share/fonts/truetype
25 ''
26 else
27 ''
28 install -Dm644 otf/static/*.otf -t $out/share/fonts/opentype
29 install -Dm644 ttf/static/*.ttf -t $out/share/fonts/truetype
30 ''
31 }
32
33 runHook postInstall
34 '';
35
36 meta = {
37 description = "Monospaced font that includes programming ligatures and is designed to enhance the modern look and feel of the Windows Terminal";
38 homepage = "https://github.com/microsoft/cascadia-code";
39 changelog = "https://github.com/microsoft/cascadia-code/raw/v${finalAttrs.version}/FONTLOG.txt";
40 license = lib.licenses.ofl;
41 maintainers = with lib.maintainers; [ ryanccn ];
42 platforms = lib.platforms.all;
43 };
44})