From 9fb2c88df488086746ecfd1e1bd7fbdec7b987b0 Mon Sep 17 00:00:00 2001 From: Gabriel Ebner Date: Mon, 17 Aug 2020 19:16:59 +0200 Subject: [PATCH] source-han-*: reduce closure size by 2x The file name of the installed font was the path returned by fetchurl: `xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-SourceHanSans.ttc` This caused the derivation to reference the downloaded font file, storing the font twice unless you optimise the store (each file is ~150M). --- pkgs/data/fonts/source-han/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/data/fonts/source-han/default.nix b/pkgs/data/fonts/source-han/default.nix index 7b6bef0198d..28ec08f63b6 100644 --- a/pkgs/data/fonts/source-han/default.nix +++ b/pkgs/data/fonts/source-han/default.nix @@ -19,7 +19,8 @@ let version = lib.removeSuffix "R" rev; buildCommand = '' - install -m444 -Dt $out/share/fonts/opentype/source-han-${family} ${ttc} + mkdir -p $out/share/fonts/opentype/source-han-${family} + ln -s ${ttc} $out/share/fonts/opentype/source-han-${family}/SourceHan${Family}.ttc ''; meta = {