about summary refs log tree commit diff
path: root/pkgs/data/fonts
diff options
context:
space:
mode:
authorGabriel Ebner <gebner@gebner.org>2020-08-17 19:16:59 +0200
committerGabriel Ebner <gebner@gebner.org>2020-08-17 19:23:12 +0200
commit9fb2c88df488086746ecfd1e1bd7fbdec7b987b0 (patch)
tree42ac4b807517e087925cb559f5f206667fdd1cdd /pkgs/data/fonts
parent1e3f09feaa5667be4ed6eca96a984b4642420b83 (diff)
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).
Diffstat (limited to 'pkgs/data/fonts')
-rw-r--r--pkgs/data/fonts/source-han/default.nix3
1 files changed, 2 insertions, 1 deletions
diff --git a/pkgs/data/fonts/source-han/default.nix b/pkgs/data/fonts/source-han/default.nix
index 7b6bef0198da4..28ec08f63b6d4 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 = {