1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2025-03-13 20:30:02 +00:00

re-add fonts on every rebuild

This commit is contained in:
Piotr Limanowski 2018-09-30 14:37:31 +02:00
parent 7a7cbdc165
commit b10e114e33

View file

@ -23,15 +23,16 @@ in {
};
};
config = mkIf cfg.enableFontDir {
config = {
system.build.fonts = pkgs.buildEnv {
name = "system-fonts";
paths = cfg.fonts;
pathsToLink = "/share/fonts/truetype";
};
system.activationScripts.fonts.text = ''
system.activationScripts.fonts.text = optionalString cfg.enableFontDir ''
# Set up fonts.
echo "setting up fonts..." >&2
fontrestore default -n 2>&1 | grep -o '/Library/Fonts/.*' | tr '\n' '\0' | xargs -0 sudo rm
/bin/ln -hf ${config.system.build.fonts}/share/fonts/truetype/* /Library/Fonts/
'';
environment.pathsToLink = [ "/share/fonts/truetype" ];