1
1
mirror of https://github.com/LnL7/nix-darwin.git synced 2024-09-11 12:49:18 +03:00

fonts: refactor system.build.fonts

Process substitution behaves better with variables and it's good
practice to use `lib.escapeShellArgs`.
This commit is contained in:
Emily 2023-08-03 02:11:40 +01:00
parent 09e72ff9b9
commit 27517d2d18

View File

@ -41,9 +41,14 @@ in
''
mkdir -p $out/Library/Fonts
font_regexp='.*\.\(ttf\|ttc\|otf\|dfont\)'
find -L ${toString cfg.fonts} -regex "$font_regexp" -type f -print0 | while IFS= read -rd "" f; do
ln -sf "$f" $out/Library/Fonts
done
while IFS= read -rd "" f; do
ln -sf "$f" "$out/Library/Fonts"
done < <(
find -L ${lib.escapeShellArgs cfg.fonts} \
-type f \
-regex "$font_regexp" \
-print0
)
'';
system.activationScripts.fonts.text = lib.optionalString cfg.fontDir.enable ''