meta: add at least 24 commits into one
This commit is contained in:
parent
db2564d828
commit
6420ebef60
25 changed files with 363 additions and 579 deletions
|
@ -3,65 +3,71 @@
|
|||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
cfg = config.alqueva.system.fonts;
|
||||
inherit (lib) types mkOption;
|
||||
mkStringsOption = default: letterform:
|
||||
mkStringsOption =
|
||||
default: letterform:
|
||||
mkOption {
|
||||
type = types.listOf types.str;
|
||||
inherit default;
|
||||
description = "The default fonts for ${letterform}.";
|
||||
};
|
||||
mkPackagesOption = default: letterform:
|
||||
mkPackagesOption =
|
||||
default: letterform:
|
||||
mkOption {
|
||||
type = types.listOf types.package;
|
||||
inherit default;
|
||||
description = "The packages you want to use for your ${letterform} fonts.";
|
||||
};
|
||||
in {
|
||||
in
|
||||
{
|
||||
options.alqueva.system.fonts = {
|
||||
enable = lib.mkEnableOption "" // {description = "Whether you want to use this fonts module.";};
|
||||
enable = lib.mkEnableOption "" // {
|
||||
description = "Whether you want to use this fonts module.";
|
||||
};
|
||||
packages =
|
||||
{
|
||||
extra = mkOption {
|
||||
type = types.listOf types.package;
|
||||
default = [];
|
||||
default = [ ];
|
||||
description = "Extra font packages you want installed.";
|
||||
};
|
||||
}
|
||||
// builtins.mapAttrs (_n: v: mkPackagesOption v.default v.letterform) {
|
||||
sansSerif = {
|
||||
default = [pkgs.roboto];
|
||||
default = [ pkgs.roboto ];
|
||||
letterform = "sans-serif";
|
||||
};
|
||||
monospace = {
|
||||
default = [pkgs.roboto-mono];
|
||||
default = [ pkgs.roboto-mono ];
|
||||
letterform = "monospace";
|
||||
};
|
||||
serif = {
|
||||
default = [pkgs.roboto-serif];
|
||||
default = [ pkgs.roboto-serif ];
|
||||
letterform = "serif";
|
||||
};
|
||||
emoji = {
|
||||
default = [pkgs.noto-fonts-color-emoji];
|
||||
default = [ pkgs.noto-fonts-color-emoji ];
|
||||
letterform = "emoji";
|
||||
};
|
||||
};
|
||||
names = builtins.mapAttrs (_n: v: mkStringsOption v.default v.letterform) {
|
||||
sansSerif = {
|
||||
default = ["Roboto"];
|
||||
default = [ "Roboto" ];
|
||||
letterform = "sans-serif";
|
||||
};
|
||||
monospace = {
|
||||
default = ["Roboto Mono"];
|
||||
default = [ "Roboto Mono" ];
|
||||
letterform = "monospace";
|
||||
};
|
||||
serif = {
|
||||
default = ["Roboto Serif"];
|
||||
default = [ "Roboto Serif" ];
|
||||
letterform = "serif";
|
||||
};
|
||||
emoji = {
|
||||
default = ["Noto Color Emoji"];
|
||||
default = [ "Noto Color Emoji" ];
|
||||
letterform = "emoji";
|
||||
};
|
||||
};
|
||||
|
@ -71,7 +77,12 @@ in {
|
|||
packages = builtins.concatLists (builtins.attrValues cfg.packages);
|
||||
fontconfig = {
|
||||
defaultFonts = {
|
||||
inherit (cfg.names) sansSerif monospace serif emoji;
|
||||
inherit (cfg.names)
|
||||
sansSerif
|
||||
monospace
|
||||
serif
|
||||
emoji
|
||||
;
|
||||
};
|
||||
enable = true;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue