45 lines
965 B
Nix
45 lines
965 B
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
inputs,
|
|
...
|
|
}:
|
|
let
|
|
customFonts = pkgs.stdenvNoCC.mkDerivation {
|
|
name = "custom-fonts";
|
|
src = inputs.fonts;
|
|
installPhase = ''
|
|
mkdir -p $out/share/fonts
|
|
find $src -type f \( \
|
|
-name "*.ttf" -o \
|
|
-name "*.otf" -o \
|
|
-name "*.woff" -o \
|
|
-name "*.woff2" \
|
|
\) -exec cp {} $out/share/fonts/ \;
|
|
'';
|
|
};
|
|
in
|
|
{
|
|
options.my.apps.fonts.enable = lib.mkEnableOption "additional fonts and typography";
|
|
config = lib.mkIf config.my.apps.fonts.enable {
|
|
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ "corefonts" ];
|
|
fonts.packages = builtins.attrValues {
|
|
inherit customFonts;
|
|
inherit (pkgs)
|
|
symbola
|
|
comic-neue
|
|
cascadia-code
|
|
corefonts
|
|
;
|
|
inherit (pkgs.nerd-fonts)
|
|
caskaydia-cove
|
|
open-dyslexic
|
|
comic-shanns-mono
|
|
iosevka
|
|
agave
|
|
;
|
|
};
|
|
};
|
|
}
|