diff --git a/options/custom/default.nix b/options/custom/default.nix index c11e883..e8f3aea 100644 --- a/options/custom/default.nix +++ b/options/custom/default.nix @@ -61,12 +61,5 @@ in { desktop = mkOption {default = "google-chrome.desktop";}; }; - - font = { - emoji = mkOption {default = "Noto Color Emoji";}; - monospace = mkOption {default = "IosevkaTerm NFP SemiBold";}; - sans-serif = mkOption {default = "Outfit";}; - serif = mkOption {default = "Liberation Serif";}; - }; }; } diff --git a/options/custom/desktops/hyprland/plugins.nix b/options/custom/desktops/hyprland/plugins.nix index 3c332da..6d9bf27 100644 --- a/options/custom/desktops/hyprland/plugins.nix +++ b/options/custom/desktops/hyprland/plugins.nix @@ -49,7 +49,7 @@ in { bar_padding = 10; bar_precedence_over_border = true; # Render borders around hyprbars bar_text_align = "left"; - bar_text_font = config.custom.font.monospace; + bar_text_font = config.custom.settings.fonts.monospace; bar_text_size = 11; #// bar_title_enabled = false; "col.text" = "rgb(93a1a1)"; diff --git a/options/custom/desktops/hyprland/settings.nix b/options/custom/desktops/hyprland/settings.nix index 1afdc68..23444ae 100644 --- a/options/custom/desktops/hyprland/settings.nix +++ b/options/custom/desktops/hyprland/settings.nix @@ -185,7 +185,7 @@ in { disable_hyprland_logo = true; disable_splash_rendering = true; focus_on_activate = true; - font_family = config.custom.font.monospace; + font_family = config.custom.settings.fonts.monospace; force_default_wallpaper = 0; initial_workspace_tracking = 2; # All children key_press_enables_dpms = true; diff --git a/options/custom/programs/anyrun.nix b/options/custom/programs/anyrun.nix index 7eb8d06..f4a589c 100644 --- a/options/custom/programs/anyrun.nix +++ b/options/custom/programs/anyrun.nix @@ -47,7 +47,7 @@ in { *:focus { outline: none; } #window { - font: 16px ${config.custom.font.monospace}; + font: 16px ${config.custom.settings.fonts.monospace}; background: none; } diff --git a/options/custom/programs/firefox.nix b/options/custom/programs/firefox.nix index a285de6..2d293e7 100644 --- a/options/custom/programs/firefox.nix +++ b/options/custom/programs/firefox.nix @@ -72,15 +72,15 @@ in { "gnomeTheme.bookmarksToolbarUnderTabs" = true; #// "gnomeTheme.systemIcons" = true; - "font.default.x-unicode" = config.custom.font.sans-serif; - "font.default.x-western" = config.custom.font.sans-serif; - "font.name-list.emoji" = config.custom.font.emoji; # System emoji - "font.name.monospace.x-unicode" = config.custom.font.monospace; - "font.name.monospace.x-western" = config.custom.font.monospace; - "font.name.sans-serif.x-unicode" = config.custom.font.sans-serif; - "font.name.sans-serif.x-western" = config.custom.font.sans-serif; - "font.name.serif.x-unicode" = config.custom.font.sans-serif; - "font.name.serif.x-western" = config.custom.font.sans-serif; + "font.default.x-unicode" = config.custom.settings.fonts.sans-serif; + "font.default.x-western" = config.custom.settings.fonts.sans-serif; + "font.name-list.emoji" = config.custom.settings.fonts.emoji; # System emoji + "font.name.monospace.x-unicode" = config.custom.settings.fonts.monospace; + "font.name.monospace.x-western" = config.custom.settings.fonts.monospace; + "font.name.sans-serif.x-unicode" = config.custom.settings.fonts.sans-serif; + "font.name.sans-serif.x-western" = config.custom.settings.fonts.sans-serif; + "font.name.serif.x-unicode" = config.custom.settings.fonts.sans-serif; + "font.name.serif.x-western" = config.custom.settings.fonts.sans-serif; "full-screen-api.ignore-widgets" = false; # Fake fullscreen "full-screen-api.warning.delay" = -1; "full-screen-api.warning.timeout" = 0; diff --git a/options/custom/programs/foot.nix b/options/custom/programs/foot.nix index e59d106..69a6261 100644 --- a/options/custom/programs/foot.nix +++ b/options/custom/programs/foot.nix @@ -15,7 +15,7 @@ in { # https://codeberg.org/dnkl/foot/src/branch/master/foot.ini settings = { - main.font = "${config.custom.font.monospace}:size=12"; + main.font = "${config.custom.settings.fonts.monospace}:size=12"; scrollback.lines = 10000; # Default 1000 # Solarized Dark diff --git a/options/custom/programs/hyprlock.nix b/options/custom/programs/hyprlock.nix index b8f7b5d..20e05aa 100644 --- a/options/custom/programs/hyprlock.nix +++ b/options/custom/programs/hyprlock.nix @@ -56,7 +56,7 @@ in { # Time { color = "rgb(93a1a1)"; - font_family = config.custom.font.sans-serif; + font_family = config.custom.settings.fonts.sans-serif; font_size = 64; halign = "center"; position = "0, 200"; @@ -73,7 +73,7 @@ in { # Date { color = "rgb(93a1a1)"; - font_family = config.custom.font.sans-serif; + font_family = config.custom.settings.fonts.sans-serif; font_size = 32; halign = "center"; position = "0, 100"; @@ -85,7 +85,7 @@ in { # Fingerprint { color = "rgb(93a1a1)"; - font_family = config.custom.font.monospace; + font_family = config.custom.settings.fonts.monospace; font_size = 42; halign = "center"; position = "0, -100"; diff --git a/options/custom/programs/kitty.nix b/options/custom/programs/kitty.nix index 1613595..b78d7de 100644 --- a/options/custom/programs/kitty.nix +++ b/options/custom/programs/kitty.nix @@ -16,7 +16,7 @@ in { shellIntegration.mode = "no-cursor"; # Disable forced beam cursor font = { - name = config.custom.font.monospace; + name = config.custom.settings.fonts.monospace; size = 14; }; diff --git a/options/custom/programs/looking-glass.nix b/options/custom/programs/looking-glass.nix index 86a95e7..d9540c1 100644 --- a/options/custom/programs/looking-glass.nix +++ b/options/custom/programs/looking-glass.nix @@ -103,7 +103,7 @@ in { fullScreen = true; quickSplash = true; size = "${toString (config.custom.width / 2)}x${toString (config.custom.height / 2)}"; - uiFont = config.custom.font.monospace; + uiFont = config.custom.settings.fonts.monospace; uiSize = 24; }; }; diff --git a/options/custom/programs/rofi.nix b/options/custom/programs/rofi.nix index 2656751..20487c7 100644 --- a/options/custom/programs/rofi.nix +++ b/options/custom/programs/rofi.nix @@ -32,7 +32,7 @@ in { #?? rofi-theme-selector theme = "custom"; - font = "${config.custom.font.monospace} 16"; + font = "${config.custom.settings.fonts.monospace} 16"; # https://github.com/davatorium/rofi/blob/next/CONFIG.md extraConfig = { diff --git a/options/custom/programs/swaylock.nix b/options/custom/programs/swaylock.nix index 5e6e52d..d44668e 100644 --- a/options/custom/programs/swaylock.nix +++ b/options/custom/programs/swaylock.nix @@ -31,7 +31,7 @@ in { indicator-idle-visible = true; indicator-radius = 150; font-size = 48 * config.custom.scale; - font = config.custom.font.monospace; + font = config.custom.settings.fonts.monospace; image = mkIf config.custom.wallpaper "/tmp/altered.png"; bs-hl-color = "93a1a1"; color = "073642"; diff --git a/options/custom/programs/walker/default.nix b/options/custom/programs/walker/default.nix index 5fcfc0f..b154459 100644 --- a/options/custom/programs/walker/default.nix +++ b/options/custom/programs/walker/default.nix @@ -138,11 +138,11 @@ in { theme = { style = '' #box { - font: larger ${config.custom.font.sans-serif}; + font: larger ${config.custom.settings.fonts.sans-serif}; } placeholder { - font: larger ${config.custom.font.monospace}; + font: larger ${config.custom.settings.fonts.monospace}; } ${readFile ./style.css} diff --git a/options/custom/programs/waybar/default.nix b/options/custom/programs/waybar/default.nix index d9d929a..e01b90b 100644 --- a/options/custom/programs/waybar/default.nix +++ b/options/custom/programs/waybar/default.nix @@ -67,7 +67,7 @@ in { #?? GTK_DEBUG=interactive waybar style = let border = toString config.custom.border; - font = config.custom.font.monospace; + font = config.custom.settings.fonts.monospace; gap = toString config.custom.gap; in '' * { diff --git a/options/custom/programs/wezterm/default.nix b/options/custom/programs/wezterm/default.nix index e261137..0830eea 100644 --- a/options/custom/programs/wezterm/default.nix +++ b/options/custom/programs/wezterm/default.nix @@ -21,7 +21,7 @@ in { local act = wezterm.action local config = wezterm.config_builder() - config.font = wezterm.font('${config.custom.font.monospace}') + config.font = wezterm.font('${config.custom.settings.fonts.monospace}') -- # TODO: Remove when using Wayland config.font_size = ${toString (14 * config.custom.scale)} diff --git a/options/custom/services/mako.nix b/options/custom/services/mako.nix index f098afb..562ea53 100644 --- a/options/custom/services/mako.nix +++ b/options/custom/services/mako.nix @@ -21,7 +21,7 @@ in { anchor = "top-center"; backgroundColor = "#073642"; borderColor = "#002b36"; - font = "${config.custom.font.sans-serif} 12"; + font = "${config.custom.settings.fonts.sans-serif} 12"; layer = "overlay"; margin = "20"; padding = "10"; diff --git a/options/custom/settings/dconf/apps.nix b/options/custom/settings/dconf/apps.nix index a566ae5..103719c 100644 --- a/options/custom/settings/dconf/apps.nix +++ b/options/custom/settings/dconf/apps.nix @@ -25,7 +25,7 @@ in { fill-tabs = mkBoolean true; floating-controls = mkBoolean true; floating-controls-hover-area = mkUint32 10; - font = mkString "${config.custom.font.monospace} 14"; + font = mkString "${config.custom.settings.fonts.monospace} 14"; headerbar-drag-area = mkBoolean false; notify-process-completion = mkBoolean false; opacity = mkUint32 100; @@ -71,7 +71,7 @@ in { cursor-blink = mkBoolean false; gtk-enable-primary-paste = mkBoolean false; color-scheme = mkString "prefer-dark"; - monospace-font-name = mkString "${config.custom.font.monospace} 14"; + monospace-font-name = mkString "${config.custom.settings.fonts.monospace} 14"; }; # GNOME Files diff --git a/options/custom/settings/fonts.nix b/options/custom/settings/fonts.nix index 4ac3565..450645e 100644 --- a/options/custom/settings/fonts.nix +++ b/options/custom/settings/fonts.nix @@ -7,7 +7,13 @@ with lib; let cfg = config.custom.settings.fonts; in { - options.custom.settings.fonts.enable = mkOption {default = false;}; + options.custom.settings.fonts = { + enable = mkOption {default = false;}; + emoji = mkOption {default = "Noto Color Emoji";}; + monospace = mkOption {default = "IosevkaTerm NFP SemiBold";}; + sans-serif = mkOption {default = "Outfit";}; + serif = mkOption {default = "Liberation Serif";}; + }; config = mkIf cfg.enable { # https://wiki.nixos.org/wiki/Fonts @@ -52,10 +58,10 @@ in { #?? fc-list --brief | grep family: | sort fontconfig.defaultFonts = { - emoji = [config.custom.font.emoji]; - monospace = [config.custom.font.monospace]; - sansSerif = [config.custom.font.sans-serif]; - serif = [config.custom.font.serif]; + emoji = [cfg.emoji]; + monospace = [cfg.monospace]; + sansSerif = [cfg.sans-serif]; + serif = [cfg.serif]; }; }; diff --git a/options/custom/settings/gtk/default.nix b/options/custom/settings/gtk/default.nix index f99aaeb..a5fa3b5 100644 --- a/options/custom/settings/gtk/default.nix +++ b/options/custom/settings/gtk/default.nix @@ -21,8 +21,8 @@ in { extraCss = css; }; - font = { - name = config.custom.font.sans-serif; + font = with config.custom.settings.fonts; { + name = sans-serif; size = 12; };