summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorPiotr Limanowski <piotr@codearsonist.com>2018-09-30 14:37:31 +0200
committerPiotr Limanowski <piotr@codearsonist.com>2018-09-30 14:53:16 +0200
commitb10e114e330ebdb23619b0a4c797a69ce9857e9a (patch)
treef585447e813e200a01f7e9faa64c75cb2cd43f9d /modules
parent7a7cbdc1652a9a06c4fb52a00c6e688845964984 (diff)
re-add fonts on every rebuild
Diffstat (limited to 'modules')
-rw-r--r--modules/fonts/default.nix5
1 files changed, 3 insertions, 2 deletions
diff --git a/modules/fonts/default.nix b/modules/fonts/default.nix
index bacec1a..c330d3c 100644
--- a/modules/fonts/default.nix
+++ b/modules/fonts/default.nix
@@ -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" ];