chore: update lock file
This commit is contained in:
parent
9c64f21bbc
commit
0226353025
17 changed files with 425 additions and 86 deletions
|
@ -6,53 +6,45 @@
|
|||
}: let
|
||||
cfg = config.alqueva.fonts;
|
||||
inherit (lib) types mkOption;
|
||||
fontSubmodule = fontPackages: fontNames: {
|
||||
options = {
|
||||
packages = mkOption {
|
||||
type = types.listOf types.package;
|
||||
default = fontPackages;
|
||||
description = "Package of the font used.";
|
||||
};
|
||||
names = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = fontNames;
|
||||
description = "Name of the default font you will be using.";
|
||||
};
|
||||
};
|
||||
};
|
||||
mkFontOption = fontType: fontPackages: fontNames:
|
||||
mkStringsOption = default: letterform:
|
||||
mkOption {
|
||||
type = types.submodule (fontSubmodule fontPackages fontNames);
|
||||
description = "Options for the ${fontType} letterform.";
|
||||
type = types.listOf types.str;
|
||||
inherit default;
|
||||
description = "Which ${letterform} font packages you want to use.";
|
||||
};
|
||||
in {
|
||||
options.alqueva.fonts = {
|
||||
enable = mkEnableOption "" // {description = "Whether you want to use this fonts module.";};
|
||||
sansSerif = mkFontOption "sans-serif" [pkgs.roboto] ["Roboto"];
|
||||
monospace = mkFontOption "monospace" [pkgs.roboto-mono] ["Roboto Mono"];
|
||||
serif = mkFontOption "serif" [pkgs.roboto-serif] ["Roboto Serif"];
|
||||
emoji = mkFontOption "emoji" [pkgs.noto-fonts-color-emoji] ["Noto Color Emoji"];
|
||||
extraPackages = mkOption {
|
||||
enable = lib.mkEnableOption "" // {description = "Whether you want to use this fonts module.";};
|
||||
packages = mkOption {
|
||||
type = types.listOf types.package;
|
||||
default = [];
|
||||
description = "Extra font packages to be installed.";
|
||||
default = [pkgs.roboto pkgs.roboto-serif pkgs.roboto-mono pkgs.noto-fonts-color-emoji];
|
||||
description = "Packages related to fonts to be installed.";
|
||||
};
|
||||
names = builtins.mapAttrs (_n: v: mkStringsOption v.default v.letterform) {
|
||||
sansSerif = {
|
||||
default = ["Roboto"];
|
||||
letterform = "sans-serif";
|
||||
};
|
||||
monospace = {
|
||||
default = ["Roboto Mono"];
|
||||
letterform = "monospace";
|
||||
};
|
||||
serif = {
|
||||
default = ["Roboto Serif"];
|
||||
letterform = "serif";
|
||||
};
|
||||
emoji = {
|
||||
default = ["Noto Color Emoji"];
|
||||
letterform = "emoji";
|
||||
};
|
||||
};
|
||||
};
|
||||
config = lib.mkIf cfg.enable {
|
||||
fonts = {
|
||||
packages = builtins.concatLists [
|
||||
cfg.extraPackages
|
||||
cfg.sansSerif.packages
|
||||
cfg.monospace.packages
|
||||
cfg.serif.packages
|
||||
cfg.emoji.packages
|
||||
];
|
||||
inherit (cfg) packages;
|
||||
fontconfig = {
|
||||
defaultFonts = {
|
||||
sansSerif = cfg.sansSerif.names;
|
||||
monospace = cfg.monospace.names;
|
||||
serif = cfg.serif.names;
|
||||
emoji = cfg.emoji.names;
|
||||
inherit (cfg.names) sansSerif monospace serif emoji;
|
||||
};
|
||||
enable = true;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue