default.nix (3557B)
1 extra: 2 { config, lib, pkgs, ... }: 3 let mkfont = n: lesrc: 4 pkgs.stdenv.mkDerivation rec { 5 name = "${n}-${version}"; 6 src = pkgs.fetchurl lesrc; 7 version = "1.0"; 8 phases = ["installPhase"]; 9 10 installPhase = '' 11 mkdir -p $out/share/fonts/${n} 12 cp -v ${src} $out/share/fonts/${n} 13 ''; 14 }; 15 aldrich = 16 mkfont "aldrich" { 17 url = "https://jb55.com/s/bef303d9e370f941.ttf"; 18 sha256 = "ecc2fbf1117eed2d0b1bf32ee8624077577d568f1c785699353416b67b519227"; 19 }; 20 VarelaRound-Regular = 21 mkfont "VarelaRound-Regular" { 22 url = "https://jb55.com/s/c8bbd8415dea995f.ttf"; 23 sha256 = "c4327a38270780eb03d305de3514de62534262c73f9e7235eea6ce26904c2dc5"; 24 }; 25 Bookerly-Regular = 26 mkfont "Bookerly-Regular" { 27 url = "https://jb55.com/s/Bookerly-Regular.ttf"; 28 sha256 = "1db94d4ab763f812b3fe505c02cdeb0927251c118cc65322be23eb93a70eafd7"; 29 }; 30 Bookerly-RegularItalic = 31 mkfont "Bookerly-RegularItalic" { 32 url = "https://jb55.com/s/Bookerly-RegularItalic.ttf"; 33 sha256 = "6e364837e08fa89c0fed287a13c7149567ab5657847f666e45e523ecc9c7820b"; 34 }; 35 Bookerly-Bold = 36 mkfont "Bookerly-Bold" { 37 url = "https://jb55.com/s/Bookerly-Bold.ttf"; 38 sha256 = "367a28ceb9b2c79dbe5956624f023a54219d89f31d6d2e81e467e202273d40da"; 39 }; 40 Bookerly-BoldItalic = 41 mkfont "Bookerly-BoldItalic" { 42 url = "https://jb55.com/s/Bookerly-BoldItalic.ttf"; 43 sha256 = "d975e3260e26f1b33fc50b00540caece84a0800e9bc900922cf200645e79693f"; 44 }; 45 Questrial = 46 mkfont "Questrial" { 47 url = "https://jb55.com/s/1ccac9ff5cb42fd7.ttf"; 48 sha256 = "294729bb4bf3595490d2e3e89928e1754a7bfa91ce91e1e44ecd18c974a6dbbc"; 49 }; 50 Comfortaa-Regular = 51 mkfont "Comfortaa-Regular" { 52 url = "https://jb55.com/s/a266c50144cbad1a.ttf"; 53 sha256 = "db5133b6a09c8eba78b29dc05019d8f361f350483d679fd8c668e1c657a303fc"; 54 }; 55 56 ohsnap = 57 pkgs.stdenv.mkDerivation rec { 58 name = "ohsnap-${version}"; 59 version = "1.7.9"; 60 61 src = pkgs.fetchzip { 62 url = "https://sourceforge.net/projects/osnapfont/files/${name}.tar.gz"; 63 sha256 = "0jvgii1sdv3gzmx8k68bd3fp2rmfsdigg67spbi2c83krb1x445v"; 64 }; 65 66 phases = ["unpackPhase" "installPhase"]; 67 68 installPhase = '' 69 mkdir -p $out/share/fonts/ohsnap 70 cp ${src}/* $out/share/fonts/ohsnap 71 ''; 72 }; 73 74 myfonts = [ aldrich VarelaRound-Regular Questrial Comfortaa-Regular 75 Bookerly-Regular Bookerly-RegularItalic Bookerly-Bold Bookerly-BoldItalic ohsnap ]; 76 in 77 { 78 fonts = { 79 fontDir.enable = true; 80 enableGhostscriptFonts = true; 81 fontconfig.defaultFonts.serif = [ "Bookerly" ]; 82 fontconfig.defaultFonts.monospace = [ "Inconsolata" ]; 83 fontconfig.defaultFonts.sansSerif = [ "Noto Sans" ]; 84 enableDefaultFonts = if extra.is-minimal then false else true; 85 fonts = if extra.is-minimal then [pkgs.terminus_font] else (with pkgs; [ 86 aldrich 87 corefonts 88 # emojione 89 fira-code 90 fira-mono 91 inconsolata 92 ipafont 93 kochi-substitute 94 libertinus 95 ibm-plex 96 noto-fonts 97 noto-fonts-emoji 98 open-sans 99 raleway 100 profont 101 terminus_font 102 paratype-pt-mono 103 source-code-pro 104 ubuntu_font_family 105 proggyfonts 106 ] ++ myfonts); 107 }; 108 }