diff options
Diffstat (limited to 'pkgs/data/fonts/noto-fonts/default.nix')
-rw-r--r-- | pkgs/data/fonts/noto-fonts/default.nix | 48 |
1 files changed, 46 insertions, 2 deletions
diff --git a/pkgs/data/fonts/noto-fonts/default.nix b/pkgs/data/fonts/noto-fonts/default.nix index 65daffe0ee5..79288cb5f4c 100644 --- a/pkgs/data/fonts/noto-fonts/default.nix +++ b/pkgs/data/fonts/noto-fonts/default.nix @@ -164,7 +164,7 @@ rec { sha256 = "sha256-y1103SS0qkZMhEL5+7kQZ+OBs5tRaqkqOcs4796Fzhg="; }; - noto-fonts-emoji = + noto-fonts-color-emoji = let version = "2.038"; emojiPythonEnv = @@ -217,7 +217,7 @@ rec { ''; meta = with lib; { - description = "Color and Black-and-White emoji fonts"; + description = "Color emoji font"; homepage = "https://github.com/googlefonts/noto-emoji"; license = with licenses; [ ofl asl20 ]; platforms = platforms.all; @@ -225,6 +225,50 @@ rec { }; }; + noto-fonts-monochrome-emoji = + # Metadata fetched from + # https://www.googleapis.com/webfonts/v1/webfonts?key=${GOOGLE_FONTS_TOKEN}&family=Noto+Emoji + let metadata = with builtins; head (fromJSON (readFile ./noto-emoji.json)).items; + urlHashes = with builtins; fromJSON (readFile ./noto-emoji.hashes.json); + + in + stdenvNoCC.mkDerivation { + pname = "noto-fonts-monochrome-emoji"; + version = "${lib.removePrefix "v" metadata.version}.${metadata.lastModified}"; + preferLocalBuild = true; + + dontUnpack = true; + srcs = let + weightNames = { + "300" = "Light"; + regular = "Regular"; + "500" = "Medium"; + "600" = "SemiBold"; + "700" = "Bold"; + }; + in lib.mapAttrsToList + (variant: url: fetchurl { name = "NotoEmoji-${weightNames.${variant}}.ttf"; + hash = urlHashes.${url}; + inherit url; } ) + metadata.files; + + installPhase = '' + for src in $srcs; do + install -D $src $out/share/fonts/noto/$(stripHash $src) + done + ''; + + meta = with lib; { + description = "Monochrome emoji font"; + homepage = "https://fonts.google.com/noto/specimen/Noto+Emoji"; + license = [ licenses.ofl ]; + maintainers = [ maintainers.nicoo ]; + + platforms = platforms.all; + sourceProvenance = [ sourceTypes.binaryBytecode ]; + }; + }; + noto-fonts-emoji-blob-bin = let pname = "noto-fonts-emoji-blob-bin"; |