nix-home/modules/personal/fonts/default.nix

63 lines
1.7 KiB
Nix
Raw Normal View History

2021-11-08 21:21:27 +00:00
{ pkgs, lib, config, ... }:
with lib;
2023-03-31 14:48:43 +00:00
let
noto-fonts-emoji-blob-bin =
let
pname = "noto-fonts-emoji-blob-bin";
version = "15.0";
in
pkgs.fetchurl {
name = "${pname}-${version}";
url = "https://github.com/C1710/blobmoji/releases/download/v${version}/Blobmoji.ttf";
sha256 = "sha256-n5yVk2w9x7UVrMe0Ho6nwu1Z9E/ktjo1UHdHKStoJWc=";
downloadToTemp = true;
recursiveHash = true;
postFetch = ''
install -Dm 444 $downloadedFile $out/share/fonts/blobmoji/Blobmoji.ttf
'';
};
in
2021-11-08 21:21:27 +00:00
{
# Fonts
config.fonts = {
fonts = with pkgs; [
noto-fonts-emoji-blob-bin
ibm-plex
2023-04-16 10:49:10 +00:00
(nerdfonts.override { fonts = [ "NerdFontsSymbolsOnly" ]; })
2021-11-08 21:21:27 +00:00
noto-fonts
noto-fonts-cjk
2021-11-08 23:08:33 +00:00
merriweather
2021-11-08 21:21:27 +00:00
];
2022-10-27 19:05:33 +00:00
} // (if pkgs.stdenv.isLinux then {
2021-11-08 21:21:27 +00:00
enableDefaultFonts = false;
fontconfig = {
defaultFonts = {
emoji = lib.mkBefore [ "Blobmoji" ];
serif = lib.mkBefore [ "IBM Plex Serif" "IBM Plex Sans JP" "IBM Plex Sans KR" ];
sansSerif = lib.mkBefore [ "IBM Plex Sans" "IBM Plex Sans JP" "IBM Plex Sans KR" ];
2021-11-08 21:21:27 +00:00
monospace = lib.mkBefore [ "IBM Plex Mono" ];
};
localConf = ''
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<fontconfig>
<alias binding="same">
<family>system-ui</family>
<prefer>
<family>IBM Plex Sans</family>
<family>IBM Plex Sans JP</family>
<family>IBM Plex Sans KR</family>
</prefer>
</alias>
</fontconfig>
'';
2021-11-08 21:21:27 +00:00
};
2022-09-26 18:50:26 +00:00
fontDir.enable = true;
2022-10-27 19:05:33 +00:00
} else { }) // (if pkgs.stdenv.isDarwin then {
2022-05-05 16:27:12 +00:00
fontDir.enable = true;
} else { });
2021-11-08 21:21:27 +00:00
}
2023-03-31 14:48:43 +00:00