mirror of
https://github.com/LnL7/nix-darwin.git
synced 2024-12-14 11:57:34 +00: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:
parent
09e72ff9b9
commit
27517d2d18
1 changed files with 8 additions and 3 deletions
|
@ -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 ''
|
||||
|
|
Loading…
Reference in a new issue