mirror of
https://github.com/LnL7/nix-darwin.git
synced 2025-03-05 16:27:03 +00:00
fonts: Adds support if Nix is on another filesystem.
On Catalina, the default way is to install Nix on a new volume which breaks hardlinking the font files. If that is the case I just copy them.
This commit is contained in:
parent
3ec36dd667
commit
a5d863ee64
1 changed files with 5 additions and 3 deletions
|
@ -45,10 +45,12 @@ in
|
||||||
find -L "$systemConfig/Library/Fonts" -type f -print0 | while IFS= read -rd "" l; do
|
find -L "$systemConfig/Library/Fonts" -type f -print0 | while IFS= read -rd "" l; do
|
||||||
font=''${l##*/}
|
font=''${l##*/}
|
||||||
f=$(readlink -f "$l")
|
f=$(readlink -f "$l")
|
||||||
if [ ! -e "/Library/Fonts/$font" ] || [ $(stat -c '%i' "$f") != $(stat -c '%i' "/Library/Fonts/$font") ]; then
|
if [ ! -e "/Library/Fonts/$font" ]; then
|
||||||
echo "updating font $font..." >&2
|
echo "updating font $font..." >&2
|
||||||
# FIXME: hardlink, won't work if nix is on a dedicated filesystem.
|
ln -fn -- "$f" /Library/Fonts 2>/dev/null || {
|
||||||
ln -fn "$f" /Library/Fonts
|
echo "Could not create hard link. Nix is probably on another filesystem. Copying the font instead..." >&2
|
||||||
|
cp -fP "$f" /Library/Fonts
|
||||||
|
}
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue