diff options
| author | Quentin Smith <quentin@mit.edu> | 2023-04-19 16:55:22 -0400 |
|---|---|---|
| committer | Quentin Smith <quentin@mit.edu> | 2023-05-17 20:31:24 -0400 |
| commit | bc776e4940106a2578998dd3117a76d62ec0a8cc (patch) | |
| tree | 52521fddc398feb535fc2f73e12a335180cf444b /modules/fonts | |
| parent | dfbdabbb3e797334172094d4f6c0ffca8c791281 (diff) | |
Match nixos handling of fonts.fonts by looking for .ttf, .ttc, and .otf files in any directory in the passed packages
Diffstat (limited to 'modules/fonts')
| -rw-r--r-- | modules/fonts/default.nix | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/modules/fonts/default.nix b/modules/fonts/default.nix index 0f4c269..9b33db0 100644 --- a/modules/fonts/default.nix +++ b/modules/fonts/default.nix @@ -33,13 +33,12 @@ in config = { system.build.fonts = pkgs.runCommand "fonts" - { paths = cfg.fonts; preferLocalBuild = true; } + { preferLocalBuild = true; } '' mkdir -p $out/Library/Fonts - for path in $paths; do - find -L $path/share/fonts -type f -print0 | while IFS= read -rd "" f; do - ln -sf "$f" $out/Library/Fonts - done + font_regexp='.*\.\(ttf\|ttc\|otf\)' + find -L ${toString cfg.fonts} -regex "$font_regexp" -type f -print0 | while IFS= read -rd "" f; do + ln -sf "$f" $out/Library/Fonts done ''; |
