mirror of
https://github.com/LnL7/nix-darwin.git
synced 2024-12-15 17:51:01 +00:00
4d892e7774
The new implementation is a bit smarter and only updates fonts that changed. But more importantly /run/current-system isn't used anymore which breaks initial activation and installs the previous set of fonts instead of the one in the new system. Fixes #115
24 lines
564 B
Nix
24 lines
564 B
Nix
{ config, pkgs, ... }:
|
|
|
|
let
|
|
font = pkgs.runCommand "font-0.0.0" {} ''
|
|
mkdir -p $out/share/fonts
|
|
touch $out/share/fonts/Font.ttf
|
|
'';
|
|
in
|
|
|
|
{
|
|
fonts.enableFontDir = true;
|
|
fonts.fonts = [ font ];
|
|
|
|
test = ''
|
|
echo "checking fonts in /Library/Fonts" >&2
|
|
test -e ${config.out}/Library/Fonts/Font.ttf
|
|
|
|
echo "checking activation of fonts in /activate" >&2
|
|
grep "fontrestore default -n 2>&1" ${config.out}/activate
|
|
grep 'ln -fn ".*" /Library/Fonts' ${config.out}/activate
|
|
grep 'rm "/Library/Fonts/.*"' ${config.out}/activate
|
|
'';
|
|
}
|
|
|