fork/home-manager

git clone https://git.julia.blue/fork/home-manager

Ryan BurnsReplace pkgs.hostPlatform by pkgs.stdenv.hostPlatform781d25b3

master
778 B29 linesraw
1{ config, lib, pkgs, ... }:
2
3with lib;
4
5let
6  homeDir = config.home.homeDirectory;
7  fontsEnv = pkgs.buildEnv {
8    name = "home-manager-fonts";
9    paths = config.home.packages;
10    pathsToLink = "/share/fonts";
11  };
12  fonts = "${fontsEnv}/share/fonts";
13in {
14  # macOS won't recognize symlinked fonts
15  config = mkIf pkgs.stdenv.hostPlatform.isDarwin {
16    home.activation.copyFonts = hm.dag.entryAfter [ "writeBoundary" ] ''
17      copyFonts() {
18        rm -rf ${homeDir}/Library/Fonts/HomeManager || :
19
20        local f
21        find -L "${fonts}" -type f -printf '%P\0' | while IFS= read -rd "" f; do
22          $DRY_RUN_CMD install $VERBOSE_ARG -Dm644 -T \
23            "${fonts}/$f" "${homeDir}/Library/Fonts/HomeManager/$f"
24        done
25      }
26      copyFonts
27    '';
28  };
29}