1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2025-03-13 20:30:02 +00:00

Match nixos handling of fonts.fonts by looking for .ttf, .ttc, and .otf files in any directory in the passed packages

This commit is contained in:
Quentin Smith 2023-04-19 16:55:22 -04:00
parent dfbdabbb3e
commit bc776e4940
No known key found for this signature in database
GPG key ID: 04EE05A8FCEFB697

View file

@ -33,13 +33,12 @@ in
config = {
system.build.fonts = pkgs.runCommand "fonts"
{ paths = cfg.fonts; preferLocalBuild = true; }
{ preferLocalBuild = true; }
''
mkdir -p $out/Library/Fonts
for path in $paths; do
find -L $path/share/fonts -type f -print0 | while IFS= read -rd "" f; do
ln -sf "$f" $out/Library/Fonts
done
font_regexp='.*\.\(ttf\|ttc\|otf\)'
find -L ${toString cfg.fonts} -regex "$font_regexp" -type f -print0 | while IFS= read -rd "" f; do
ln -sf "$f" $out/Library/Fonts
done
'';