From 380048adfc0bea0f700b25a554ad3bd257d88e9f Mon Sep 17 00:00:00 2001 From: Acid Bong Date: Fri, 7 Nov 2025 22:23:32 +0200 Subject: [PATCH 1/2] roboto-mono: 2.002-20190125 -> 3.001 - updated src to a googlefonts repo - cleaned up old attrs - Roboto Mono v3 was relicensed with SIL OFL --- pkgs/by-name/ro/roboto-mono/package.nix | 84 +++++-------------------- 1 file changed, 17 insertions(+), 67 deletions(-) diff --git a/pkgs/by-name/ro/roboto-mono/package.nix b/pkgs/by-name/ro/roboto-mono/package.nix index 3c71e0f21714..0e251e149478 100644 --- a/pkgs/by-name/ro/roboto-mono/package.nix +++ b/pkgs/by-name/ro/roboto-mono/package.nix @@ -1,77 +1,27 @@ { lib, stdenv, - fetchurl, + fetchFromGitHub, }: -let - # Latest commit touching the robotomono tree - commit = "5338537ef835a3d9ccf8faf386399f13a30605e2"; -in -stdenv.mkDerivation { +stdenv.mkDerivation (finalAttrs: { pname = "roboto-mono"; - version = "2.002-20190125"; + version = "3.001"; - srcs = [ - (fetchurl { - url = "https://raw.githubusercontent.com/google/fonts/${commit}/apache/robotomono/RobotoMono-Regular.ttf"; - sha256 = "1f96r4by67hzqpr4p2wkrfnpj9b7x9qrmwns0312w2l2rnp2qajx"; - }) - (fetchurl { - url = "https://raw.githubusercontent.com/google/fonts/${commit}/apache/robotomono/RobotoMono-Bold.ttf"; - sha256 = "10wg4dchdq4s89r9pd4h8y5l1bf8mix32pksph2wafyr3815kfnm"; - }) - (fetchurl { - url = "https://raw.githubusercontent.com/google/fonts/${commit}/apache/robotomono/RobotoMono-Italic.ttf"; - sha256 = "1cayhm3wj36q748xd0zdgrhm4pz7wnrskrlf7khxx2s41m3win5b"; - }) - (fetchurl { - url = "https://raw.githubusercontent.com/google/fonts/${commit}/apache/robotomono/RobotoMono-BoldItalic.ttf"; - sha256 = "04238dxizdlhnnnyzhnqckxf8ciwlnwyzxby6qgpyg232abx0n2z"; - }) - (fetchurl { - url = "https://raw.githubusercontent.com/google/fonts/${commit}/apache/robotomono/RobotoMono-Medium.ttf"; - sha256 = "00rh49d0dbycbkjgd2883w7iqzd6hcry08ycjipsvk091p5nq6qy"; - }) - (fetchurl { - url = "https://raw.githubusercontent.com/google/fonts/${commit}/apache/robotomono/RobotoMono-MediumItalic.ttf"; - sha256 = "0fxl6lblj7anhqmhplnpvjwckjh4g8m6r9jykxdrvpl5hk8mr65b"; - }) - (fetchurl { - url = "https://raw.githubusercontent.com/google/fonts/${commit}/apache/robotomono/RobotoMono-Light.ttf"; - sha256 = "1h8rbc2p70fabkplsafzah1wcwy92qc1wzkmc1cnb4yq28gxah4a"; - }) - (fetchurl { - url = "https://raw.githubusercontent.com/google/fonts/${commit}/apache/robotomono/RobotoMono-LightItalic.ttf"; - sha256 = "08y2qngwy61mc22f8i00gshgmcf7hwmfxh1f4j824svy4n16zhsc"; - }) - (fetchurl { - url = "https://raw.githubusercontent.com/google/fonts/${commit}/apache/robotomono/RobotoMono-Thin.ttf"; - sha256 = "0fmij9zlfjiyf0vb8n8gvrwi35l830zpmkbhcy1xgx0m8za6mmmy"; - }) - (fetchurl { - url = "https://raw.githubusercontent.com/google/fonts/${commit}/apache/robotomono/RobotoMono-ThinItalic.ttf"; - sha256 = "0mpwdhjnsk8311nw8fqzy1b7v0wzb4pw639ply1j38a0vibrsmn7"; - }) - ]; - - sourceRoot = "."; - - unpackCmd = '' - ttfName=$(basename $(stripHash $curSrc)) - cp $curSrc ./$ttfName - ''; + src = fetchFromGitHub { + owner = "googlefonts"; + repo = "robotomono"; + tag = "v${finalAttrs.version}"; + hash = "sha256-i0r8x4VgaOYW/pYXK+AXw7jMwhA8Hs9VQ1lq5f/xTe0="; + }; installPhase = '' - mkdir -p $out/share/fonts/truetype - cp -a *.ttf $out/share/fonts/truetype/ + runHook preInstall + install -Dm644 fonts/ttf/*.ttf -t $out/share/fonts/truetype/RobotoMono + runHook postInstall ''; - outputHashAlgo = "sha256"; - outputHashMode = "recursive"; - outputHash = "0fkx2z97k29n1392bf76iwdyz44yp86hmqah7ai6bikzlia38qa0"; - - meta = with lib; { + meta = { homepage = "https://www.google.com/fonts/specimen/Roboto+Mono"; description = "Google Roboto Mono fonts"; longDescription = '' @@ -85,8 +35,8 @@ stdenv.mkDerivation { wider glyphs are adjusted for weight. Curved caps like 'C' and 'O' take on the straighter sides from Roboto Condensed. ''; - license = licenses.asl20; - platforms = platforms.all; - maintainers = [ maintainers.romildo ]; + license = lib.licenses.ofl; + platforms = lib.platforms.all; + maintainers = [ lib.maintainers.romildo ]; }; -} +}) From 291a8ed602d773e615e919cafe9583aa35a86bf0 Mon Sep 17 00:00:00 2001 From: Acid Bong Date: Fri, 7 Nov 2025 22:27:45 +0200 Subject: [PATCH 2/2] roboto-mono: add update script --- pkgs/by-name/ro/roboto-mono/package.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/by-name/ro/roboto-mono/package.nix b/pkgs/by-name/ro/roboto-mono/package.nix index 0e251e149478..eaadebdb5ea8 100644 --- a/pkgs/by-name/ro/roboto-mono/package.nix +++ b/pkgs/by-name/ro/roboto-mono/package.nix @@ -2,6 +2,7 @@ lib, stdenv, fetchFromGitHub, + nix-update-script, }: stdenv.mkDerivation (finalAttrs: { @@ -21,6 +22,8 @@ stdenv.mkDerivation (finalAttrs: { runHook postInstall ''; + passthru.updateScript = nix-update-script { }; + meta = { homepage = "https://www.google.com/fonts/specimen/Roboto+Mono"; description = "Google Roboto Mono fonts";