Refactor font management: move fonts out of Home-Manager configuration and add Monocraft Nerd Fonts and Lexend
This commit is contained in:
parent
8b0aa2d2f7
commit
2d95dcf3c5
5 changed files with 84 additions and 11 deletions
|
@ -18,7 +18,6 @@
|
|||
./direnv.nix
|
||||
./fastfetch
|
||||
./fish
|
||||
./fonts.nix
|
||||
./git.nix
|
||||
./ranger.nix
|
||||
./screen.nix
|
||||
|
@ -95,6 +94,13 @@
|
|||
enable = true;
|
||||
};
|
||||
|
||||
# disable manuals as nmd fails to build often
|
||||
manual = {
|
||||
html.enable = false;
|
||||
json.enable = false;
|
||||
manpages.enable = false;
|
||||
};
|
||||
|
||||
nix = {
|
||||
package = lib.mkDefault pkgs.nix;
|
||||
settings = {
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
fonts.fontconfig.enable = true;
|
||||
home.packages = with pkgs; [
|
||||
noto-fonts
|
||||
nerd-fonts.fira-code
|
||||
meslo-lgs-nf
|
||||
monocraft
|
||||
];
|
||||
}
|
|
@ -16,6 +16,7 @@ in
|
|||
|
||||
(map lib.custom.relativeToRoot [
|
||||
"modules/common"
|
||||
"hosts/common/core/fonts.nix"
|
||||
"hosts/common/core/ssh.nix"
|
||||
"hosts/users"
|
||||
])
|
||||
|
@ -39,6 +40,9 @@ in
|
|||
sshfs
|
||||
];
|
||||
|
||||
# Enable CUPS to print documents.
|
||||
services.printing.enable = true;
|
||||
|
||||
# Force home-manager to use global packages
|
||||
home-manager.useGlobalPkgs = true;
|
||||
# If there is a conflict file that is backed up, use this extension
|
||||
|
|
47
hosts/common/core/fonts.nix
Normal file
47
hosts/common/core/fonts.nix
Normal file
|
@ -0,0 +1,47 @@
|
|||
{ pkgs, lib, ... }:
|
||||
let
|
||||
path = lib.custom.relativeToRoot "pkgs/common/monocraft-nerd-fonts/package.nix";
|
||||
monocraft-nerd-fonts = pkgs.callPackage path { inherit pkgs; };
|
||||
in
|
||||
{
|
||||
fonts = {
|
||||
packages = with pkgs; [
|
||||
# icon fonts
|
||||
material-symbols
|
||||
|
||||
# Sans(Serif) fonts
|
||||
lexend
|
||||
noto-fonts
|
||||
noto-fonts-emoji
|
||||
roboto
|
||||
(google-fonts.override {
|
||||
fonts = [
|
||||
"Inter"
|
||||
"Laila"
|
||||
];
|
||||
})
|
||||
|
||||
# monospace fonts
|
||||
monocraft
|
||||
monocraft-nerd-fonts
|
||||
|
||||
# nerdfonts
|
||||
nerd-fonts.fira-code
|
||||
nerd-fonts.symbols-only
|
||||
];
|
||||
|
||||
# causes more issues than it solves
|
||||
enableDefaultPackages = false;
|
||||
|
||||
# user defined fonts
|
||||
fontconfig = {
|
||||
enable = true;
|
||||
defaultFonts = {
|
||||
serif = [ "Laila" ];
|
||||
sansSerif = [ "Lexend" ];
|
||||
monospace = [ "Monocraft" ];
|
||||
emoji = [ "Noto Color Emoji" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
26
pkgs/common/monocraft-nerd-fonts/package.nix
Normal file
26
pkgs/common/monocraft-nerd-fonts/package.nix
Normal file
|
@ -0,0 +1,26 @@
|
|||
{ pkgs, lib, ... }:
|
||||
pkgs.stdenvNoCC.mkDerivation {
|
||||
pname = "monocraft-nerd-fonts";
|
||||
version = "4.0";
|
||||
|
||||
phases = [ "installPhase" ]; # Removes all phases except installPhase
|
||||
|
||||
src = pkgs.fetchurl {
|
||||
url = "https://github.com/IdreesInc/Monocraft/releases/download/v4.0/Monocraft-nerd-fonts-patched.ttc";
|
||||
sha256 = "95801bf21826bf8572af3787af82e77ee48df4bfb87e90c4317fcffbe7eaf037";
|
||||
};
|
||||
|
||||
# unpackPhase = ":".
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/share/fonts/truetype/
|
||||
cp -r $src $out/share/fonts/truetype/monocraft-nerd-fonts.ttc
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Monocraft Nerd Fonts";
|
||||
homepage = "https://github.com/IdreesInc/Monocraft";
|
||||
platforms = platforms.all;
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Reference in a new issue