diff options
| author | Daiderd Jordan <daiderd@gmail.com> | 2020-03-03 19:19:21 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-03-03 19:19:21 +0100 |
| commit | 1ffae69c561c67087f5023aa8b6b3dcc6078b04d (patch) | |
| tree | 962fbc939cfb12b1e7ce3070eb105eac26b3d0ee /modules | |
| parent | 6a255bd47cb003571a4b741639391a0e31cce1aa (diff) | |
| parent | 547ccd60b416e0f15e8bbdb01887dd89cb2531da (diff) | |
Merge pull request #169 from tricktron/fix/fonts-catalina
fonts: Adds support if Nix is on another filesystem.
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/fonts/default.nix | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/modules/fonts/default.nix b/modules/fonts/default.nix index f218cbe..195edd6 100644 --- a/modules/fonts/default.nix +++ b/modules/fonts/default.nix @@ -45,10 +45,12 @@ in find -L "$systemConfig/Library/Fonts" -type f -print0 | while IFS= read -rd "" l; do font=''${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 - # FIXME: hardlink, won't work if nix is on a dedicated filesystem. - ln -fn "$f" /Library/Fonts + ln -fn -- "$f" /Library/Fonts 2>/dev/null || { + echo "Could not create hard link. Nix is probably on another filesystem. Copying the font instead..." >&2 + rsync -az --inplace "$f" /Library/Fonts + } fi done |
