mirror of
https://github.com/Theaninova/TheaninovOS.git
synced 2025-12-12 19:46:20 +00:00
refactor: rfc formatting
This commit is contained in:
@@ -1,17 +1,31 @@
|
||||
{ pkgs, lib, config, ... }:
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
|
||||
let cfg = config.fonts.fira-code;
|
||||
|
||||
in {
|
||||
let
|
||||
cfg = config.fonts.fira-code;
|
||||
in
|
||||
{
|
||||
options.fonts.fira-code = {
|
||||
enable = mkEnableOption "Enable the preset for Fira Code";
|
||||
stylisticSets = mkOption {
|
||||
type = types.listOf types.str;
|
||||
description = mdDoc
|
||||
"[Stylistic sets](https://github.com/tonsky/FiraCode/wiki/How-to-enable-stylistic-sets) for Fira Code";
|
||||
default =
|
||||
[ "zero" "onum" "ss04" "cv19" "cv23" "ss09" "ss06" "ss07" "ss10" ];
|
||||
description = mdDoc "[Stylistic sets](https://github.com/tonsky/FiraCode/wiki/How-to-enable-stylistic-sets) for Fira Code";
|
||||
default = [
|
||||
"zero"
|
||||
"onum"
|
||||
"ss04"
|
||||
"cv19"
|
||||
"cv23"
|
||||
"ss09"
|
||||
"ss06"
|
||||
"ss07"
|
||||
"ss10"
|
||||
];
|
||||
};
|
||||
default = mkOption {
|
||||
type = types.bool;
|
||||
@@ -26,10 +40,7 @@ in {
|
||||
nerdfonts.additionalFonts = [ "FiraCode" ];
|
||||
fontconfig = {
|
||||
defaultFonts.monospace = mkIf cfg.default [
|
||||
(if (config.fonts.nerdfonts.enable) then
|
||||
"Fira Code Nerd Font"
|
||||
else
|
||||
"FiraCode")
|
||||
(if (config.fonts.nerdfonts.enable) then "Fira Code Nerd Font" else "FiraCode")
|
||||
];
|
||||
localConf = ''
|
||||
<match target="font">
|
||||
@@ -37,10 +48,7 @@ in {
|
||||
<string>Fira</string>
|
||||
</test>
|
||||
<edit name="fontfeatures" mode="append">
|
||||
${
|
||||
lib.concatStringsSep " "
|
||||
(map (set: "<string>${set}</string>") cfg.stylisticSets)
|
||||
}
|
||||
${lib.concatStringsSep " " (map (set: "<string>${set}</string>") cfg.stylisticSets)}
|
||||
</edit>
|
||||
</match>
|
||||
'';
|
||||
|
||||
@@ -1,9 +1,15 @@
|
||||
{ pkgs, lib, config, ... }:
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
|
||||
let cfg = config.fonts.nerdfonts;
|
||||
|
||||
in {
|
||||
let
|
||||
cfg = config.fonts.nerdfonts;
|
||||
in
|
||||
{
|
||||
options.fonts.nerdfonts = {
|
||||
enable = mkEnableOption "Enable nerdfonts";
|
||||
additionalFonts = mkOption {
|
||||
@@ -15,12 +21,9 @@ in {
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
fonts = {
|
||||
packages = with pkgs;
|
||||
[
|
||||
(nerdfonts.override {
|
||||
fonts = [ "NerdFontsSymbolsOnly" ] ++ cfg.additionalFonts;
|
||||
})
|
||||
];
|
||||
packages = with pkgs; [
|
||||
(nerdfonts.override { fonts = [ "NerdFontsSymbolsOnly" ] ++ cfg.additionalFonts; })
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,9 +1,15 @@
|
||||
{ pkgs, lib, config, ... }:
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
|
||||
let cfg = config.fonts.noto-sans;
|
||||
|
||||
in {
|
||||
let
|
||||
cfg = config.fonts.noto-sans;
|
||||
in
|
||||
{
|
||||
options.fonts.noto-sans = {
|
||||
enable = mkEnableOption "Enable the Noto Sans font";
|
||||
default = mkOption {
|
||||
@@ -15,14 +21,15 @@ in {
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
fonts = {
|
||||
packages = with pkgs; [ noto-fonts noto-fonts-cjk noto-fonts-emoji ];
|
||||
packages = with pkgs; [
|
||||
noto-fonts
|
||||
noto-fonts-cjk
|
||||
noto-fonts-emoji
|
||||
];
|
||||
nerdfonts.additionalFonts = [ "Noto" ];
|
||||
fontconfig = {
|
||||
defaultFonts.sansSerif = mkIf cfg.default [
|
||||
(if (config.fonts.nerdfonts.enable) then
|
||||
"Noto Sans Nerd Font"
|
||||
else
|
||||
"Noto Sans")
|
||||
(if (config.fonts.nerdfonts.enable) then "Noto Sans Nerd Font" else "Noto Sans")
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user