1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-03-19 14:53:00 +00:00
home-manager/modules/targets/darwin/fonts.nix
Austin Horstman 95711f9266
treewide: remove with lib (#6512)
* nixos: remove with lib
* nix-darwin: remove with lib
* home-manager: remove with lib
* modules/accounts: remove with lib
* modules/config: remove with lib
* modules/i18n: remove with lib
* modules/misc: remove with lib
* modules: remove with lib
* modules/targets: remove with lib
* tests/modules/firefox: remove with lib
* tests/modules/services: remove with lib
2025-03-07 14:16:46 -06:00

24 lines
727 B
Nix

{ config, lib, pkgs, ... }:
let
homeDir = config.home.homeDirectory;
fontsEnv = pkgs.buildEnv {
name = "home-manager-fonts";
paths = config.home.packages;
pathsToLink = "/share/fonts";
};
fonts = "${fontsEnv}/share/fonts";
installDir = "${homeDir}/Library/Fonts/HomeManager";
in {
# macOS won't recognize symlinked fonts
config = lib.mkIf pkgs.stdenv.hostPlatform.isDarwin {
home.file."Library/Fonts/.home-manager-fonts-version" = {
text = "${fontsEnv}";
onChange = ''
run mkdir -p ${lib.escapeShellArg installDir}
run ${pkgs.rsync}/bin/rsync $VERBOSE_ARG -acL --chmod=u+w --delete \
${lib.escapeShellArgs [ "${fonts}/" installDir ]}
'';
};
};
}