From 0b8dc8b94c0363420a7bf3c42e816b1662c282ad Mon Sep 17 00:00:00 2001 From: Myned <dev@bjork.tech> Date: Sat, 15 Mar 2025 17:30:53 -0500 Subject: [PATCH] theme: migrate to stylix Signed-off-by: Myned <dev@bjork.tech> --- flake.in.nix | 1 - flake.nix | 4 - options/custom/desktops/hyprland/plugins.nix | 2 +- .../custom/desktops/hyprland/variables.nix | 2 +- options/custom/desktops/niri/misc.nix | 2 +- options/custom/menus/anyrun.nix | 2 +- options/custom/menus/rofi/default.nix | 4 + options/custom/menus/walker/default.nix | 2 +- options/custom/programs/firefox/.common.nix | 39 +---- options/custom/programs/firefox/firefox.nix | 19 ++- options/custom/programs/firefox/librewolf.nix | 13 +- options/custom/programs/fish.nix | 32 ---- options/custom/programs/foot.nix | 2 +- options/custom/programs/ghostty.nix | 10 +- options/custom/programs/hyprlock.nix | 4 + options/custom/programs/kitty.nix | 5 - options/custom/programs/looking-glass.nix | 2 +- options/custom/programs/mangohud.nix | 6 + options/custom/programs/swaylock.nix | 2 +- options/custom/programs/vscode.nix | 7 + options/custom/programs/waybar/default.nix | 6 +- options/custom/programs/wezterm/default.nix | 2 +- options/custom/programs/zed.nix | 10 +- options/custom/services/mako.nix | 2 +- options/custom/settings/boot.nix | 23 --- options/custom/settings/dconf/apps.nix | 8 - options/custom/settings/dconf/gnome.nix | 5 +- options/custom/settings/default.nix | 8 +- options/custom/settings/stylix.nix | 158 +++++++++++++++++- 29 files changed, 237 insertions(+), 145 deletions(-) diff --git a/flake.in.nix b/flake.in.nix index 998dbc3..d68d737 100644 --- a/flake.in.nix +++ b/flake.in.nix @@ -77,7 +77,6 @@ ### Source code cisco-packettracer8 = source "file:///home/myned/SYNC/linux/config/cisco/CiscoPacketTracer822_amd64_signed.deb"; - firefox-gnome-theme = source "github:rafaelmardojai/firefox-gnome-theme"; lifx-cli = source "github:Rawa/lifx-cli"; steamtinkerlaunch = source "github:sonic2kk/steamtinkerlaunch"; thunderbird-gnome-theme = source "github:rafaelmardojai/thunderbird-gnome-theme"; diff --git a/flake.nix b/flake.nix index 93494c9..ee5c4f0 100644 --- a/flake.nix +++ b/flake.nix @@ -46,10 +46,6 @@ inputs.nixpkgs.follows = "nixpkgs-unstable"; url = "github:nix-community/disko"; }; - firefox-gnome-theme = { - flake = false; - url = "github:rafaelmardojai/firefox-gnome-theme"; - }; flakegen.url = "github:jorsn/flakegen"; fw-fanctrl = { inputs.nixpkgs.follows = "nixpkgs-unstable"; diff --git a/options/custom/desktops/hyprland/plugins.nix b/options/custom/desktops/hyprland/plugins.nix index 23ec514..dbb8ce9 100644 --- a/options/custom/desktops/hyprland/plugins.nix +++ b/options/custom/desktops/hyprland/plugins.nix @@ -44,7 +44,7 @@ in { bar_padding = 10; bar_precedence_over_border = true; # Render borders around hyprbars bar_text_align = "left"; - bar_text_font = config.custom.settings.fonts.monospace; + bar_text_font = config.stylix.fonts.monospace.name; bar_text_size = 11; #// bar_title_enabled = false; "col.text" = "rgb(93a1a1)"; diff --git a/options/custom/desktops/hyprland/variables.nix b/options/custom/desktops/hyprland/variables.nix index a23a823..c9bb76e 100644 --- a/options/custom/desktops/hyprland/variables.nix +++ b/options/custom/desktops/hyprland/variables.nix @@ -177,7 +177,7 @@ in { disable_hyprland_logo = true; disable_splash_rendering = true; focus_on_activate = true; - font_family = config.custom.settings.fonts.monospace; + font_family = config.stylix.fonts.monospace.name; force_default_wallpaper = 0; #// initial_workspace_tracking = 2; # All children key_press_enables_dpms = true; diff --git a/options/custom/desktops/niri/misc.nix b/options/custom/desktops/niri/misc.nix index 67ef855..e2aeec3 100644 --- a/options/custom/desktops/niri/misc.nix +++ b/options/custom/desktops/niri/misc.nix @@ -27,7 +27,7 @@ in { # https://github.com/YaLTeR/niri/wiki/Configuration:-Miscellaneous programs.niri.settings = { # https://github.com/sodiboo/niri-flake/blob/main/docs.md#programsnirisettingscursorhide-after-inactive-ms - cursor = with config.custom.settings.icons.cursor; { + cursor = with config.stylix.cursor; { inherit size; theme = name; diff --git a/options/custom/menus/anyrun.nix b/options/custom/menus/anyrun.nix index eea7057..e65ae52 100644 --- a/options/custom/menus/anyrun.nix +++ b/options/custom/menus/anyrun.nix @@ -45,7 +45,7 @@ in { *:focus { outline: none; } #window { - font: 16px ${config.custom.settings.fonts.monospace}; + font: 16px ${config.stylix.fonts.monospace.name}; background: none; } diff --git a/options/custom/menus/rofi/default.nix b/options/custom/menus/rofi/default.nix index 2d92467..46c6b92 100644 --- a/options/custom/menus/rofi/default.nix +++ b/options/custom/menus/rofi/default.nix @@ -116,6 +116,10 @@ in { }); }; }; + + # TODO: Use stylix + # https://stylix.danth.me/options/modules/rofi.html + stylix.targets.rofi.enable = false; } ]; }; diff --git a/options/custom/menus/walker/default.nix b/options/custom/menus/walker/default.nix index 110ea6a..97f1eb8 100644 --- a/options/custom/menus/walker/default.nix +++ b/options/custom/menus/walker/default.nix @@ -205,7 +205,7 @@ in { style = '' #box { border: ${toString config.custom.border}px #073642 solid; - font: larger ${config.custom.settings.fonts.sans-serif}; + font: larger ${config.stylix.fonts.sansSerif.name}; } ${readFile ./style.css} diff --git a/options/custom/programs/firefox/.common.nix b/options/custom/programs/firefox/.common.nix index 8e916de..5152773 100644 --- a/options/custom/programs/firefox/.common.nix +++ b/options/custom/programs/firefox/.common.nix @@ -3,6 +3,7 @@ inputs, lib, pkgs, + profile ? "default", theme ? false, ... }: @@ -16,7 +17,7 @@ with lib; { #!! Prefer policies over profiles when possible #?? about:profiles - profiles.default = { + profiles.${profile} = { # https://nur.nix-community.org/repos/rycee/ extensions.packages = with pkgs.nur.repos.rycee.firefox-addons; optionals config.custom.minimal [ @@ -51,30 +52,9 @@ with lib; { # TODO: Consider other themes # https://github.com/soulhotel/FF-ULTIMA - # BUG: Tab groups not yet supported - # https://github.com/rafaelmardojai/firefox-gnome-theme/issues/901 - # https://github.com/rafaelmardojai/firefox-gnome-theme # https://github.com/rafaelmardojai/firefox-gnome-theme/blob/master/theme/colors/dark.css - userChrome = '' - ${ - if theme - then "@import ${inputs.firefox-gnome-theme}/userChrome.css" - else "" - } - - ${builtins.readFile ./userChrome.css} - ''; - - userContent = '' - ${ - if theme - then "@import ${inputs.firefox-gnome-theme}/userContent.css" - else "" - } - - ${builtins.readFile ./userContent.css} - ''; - + userChrome = builtins.readFile ./userChrome.css; + userContent = builtins.readFile ./userContent.css; containersForce = true; containers = { @@ -91,7 +71,7 @@ with lib; { }; }; - settings = with config.custom.settings.fonts; + settings = { "accessibility.browsewithcaret" = false; "accessibility.typeaheadfind" = false; @@ -197,15 +177,6 @@ with lib; { "extensions.pocket.enabled" = false; "extensions.update.autoUpdateDefault" = true; "extensions.update.enabled" = true; - "font.default.x-unicode" = sans-serif; - "font.default.x-western" = sans-serif; - "font.name-list.emoji" = emoji; # System emoji - "font.name.monospace.x-unicode" = monospace; - "font.name.monospace.x-western" = monospace; - "font.name.sans-serif.x-unicode" = sans-serif; - "font.name.sans-serif.x-western" = sans-serif; - "font.name.serif.x-unicode" = sans-serif; - "font.name.serif.x-western" = 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/firefox/firefox.nix b/options/custom/programs/firefox/firefox.nix index 95c23da..a77f82d 100644 --- a/options/custom/programs/firefox/firefox.nix +++ b/options/custom/programs/firefox/firefox.nix @@ -10,6 +10,7 @@ with lib; let in { options.custom.programs.firefox = { enable = mkOption {default = false;}; + profile = mkOption {default = "default";}; }; config = mkIf cfg.enable { @@ -17,17 +18,25 @@ in { { # https://www.mozilla.org/en-US/firefox/developer programs.firefox = mkMerge [ - (import ./.common.nix {inherit config inputs lib pkgs;}) + (import ./.common.nix { + inherit config inputs lib pkgs; + profile = cfg.profile; + theme = true; + }) { enable = true; + #// package = pkgs.firefox-devedition-bin; } ]; - home.file = { - ".mozilla/profiles.ini" = { - force = true; - }; + # https://stylix.danth.me/options/modules/firefox.html + stylix.targets.firefox = { + # BUG: Tab groups not yet supported + # https://github.com/rafaelmardojai/firefox-gnome-theme/issues/901 + # https://github.com/rafaelmardojai/firefox-gnome-theme + firefoxGnomeTheme.enable = true; + profileNames = [cfg.profile]; }; } ]; diff --git a/options/custom/programs/firefox/librewolf.nix b/options/custom/programs/firefox/librewolf.nix index d6234c4..18d02b7 100644 --- a/options/custom/programs/firefox/librewolf.nix +++ b/options/custom/programs/firefox/librewolf.nix @@ -10,6 +10,7 @@ with lib; let in { options.custom.programs.librewolf = { enable = mkOption {default = false;}; + profile = mkOption {default = "default";}; }; config = mkIf cfg.enable { @@ -18,7 +19,10 @@ in { # https://librewolf.net/ # https://codeberg.org/librewolf programs.librewolf = mkMerge [ - (import ./.common.nix {inherit config inputs lib pkgs;}) + (import ./.common.nix { + inherit config inputs lib pkgs; + profile = cfg.profile; + }) { enable = true; @@ -30,6 +34,13 @@ in { force = true; }; }; + + # https://stylix.danth.me/options/modules/firefox.html + stylix.targets.librewolf = { + # https://github.com/rafaelmardojai/firefox-gnome-theme + firefoxGnomeTheme.enable = true; + profileNames = [cfg.profile]; + }; } ]; }; diff --git a/options/custom/programs/fish.nix b/options/custom/programs/fish.nix index 483cb41..e0dda17 100644 --- a/options/custom/programs/fish.nix +++ b/options/custom/programs/fish.nix @@ -297,38 +297,6 @@ in { interactiveShellInit = '' # Disable greeting set -g fish_greeting - - # Default is brblack (bright0) - set -g fish_color_autosuggestion brgreen - - ### Interactive - # function exit -d 'Always exit successfully when interactive' - # builtin exit 0 - # end - - # TODO: Pass flags properly - # TODO: Convert to bash - # function run -d 'Run packages via nixpkg flakes' - # for i in (seq (count $argv)) - # if ! string match -r '^-' -- $argv[$i] - # set argv[$i] (string replace -r ^ nixpkgs# $argv[$i]) - # end - # end - # nix run $argv - # end - - # function shell -d 'Open packages in new shell via nixpkg flakes' - # for i in (seq (count $argv)) - # if ! string match -r '^-' -- $argv[$i] - # set argv[$i] (string replace -r ^ nixpkgs# $argv[$i]) - # end - # end - # nix shell $argv - # end - - # function activate -d 'Activate Python venv' - # source .venv/bin/activate.fish - # end ''; }; }; diff --git a/options/custom/programs/foot.nix b/options/custom/programs/foot.nix index 69a6261..9db93ae 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.settings.fonts.monospace}:size=12"; + main.font = "${config.stylix.fonts.monospace.name}:size=12"; scrollback.lines = 10000; # Default 1000 # Solarized Dark diff --git a/options/custom/programs/ghostty.nix b/options/custom/programs/ghostty.nix index 4b68605..cdd2e30 100644 --- a/options/custom/programs/ghostty.nix +++ b/options/custom/programs/ghostty.nix @@ -41,10 +41,7 @@ in { # https://ghostty.org/docs/config/reference#font-family #?? ghostty +list-fonts #?? ghostty +show-face - font-family = with config.custom.settings.fonts; ["monospace" fallback]; - - # https://ghostty.org/docs/config/reference#font-size - font-size = 14; + font-family = mkForce ["monospace" "Unifont"]; # Force unifont icons # https://ghostty.org/docs/config/reference#freetype-load-flags # https://github.com/ghostty-org/ghostty/discussions/3515 @@ -65,11 +62,6 @@ in { # https://ghostty.org/docs/config/reference#shell-integration-features shell-integration-features = "no-cursor"; - # https://ghostty.org/docs/features/theme - # https://ghostty.org/docs/config/reference#theme - #?? ghostty +list-themes - theme = "Builtin Solarized Dark"; - # https://ghostty.org/docs/config/reference#window-decoration window-decoration = false; diff --git a/options/custom/programs/hyprlock.nix b/options/custom/programs/hyprlock.nix index 68cc410..e3a7d37 100644 --- a/options/custom/programs/hyprlock.nix +++ b/options/custom/programs/hyprlock.nix @@ -101,6 +101,10 @@ in { ]; }; }; + + # TODO: Use stylix + # https://stylix.danth.me/options/modules/hyprlock.html + stylix.targets.hyprlock.enable = false; } ]; }; diff --git a/options/custom/programs/kitty.nix b/options/custom/programs/kitty.nix index b78d7de..8921d25 100644 --- a/options/custom/programs/kitty.nix +++ b/options/custom/programs/kitty.nix @@ -15,11 +15,6 @@ in { enable = true; shellIntegration.mode = "no-cursor"; # Disable forced beam cursor - font = { - name = config.custom.settings.fonts.monospace; - size = 14; - }; - # https://sw.kovidgoyal.net/kitty/conf/ #?? man kitty settings = { diff --git a/options/custom/programs/looking-glass.nix b/options/custom/programs/looking-glass.nix index d9540c1..75b5263 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.settings.fonts.monospace; + uiFont = config.stylix.fonts.monospace.name; uiSize = 24; }; }; diff --git a/options/custom/programs/mangohud.nix b/options/custom/programs/mangohud.nix index 71f93f3..c58dea6 100644 --- a/options/custom/programs/mangohud.nix +++ b/options/custom/programs/mangohud.nix @@ -60,5 +60,11 @@ in { vram_color = "6c71c4"; }; }; + + # TODO: Use stylix + # https://stylix.danth.me/options/modules/mangohud.html + stylix.targets.mangohud.enable = false; + } + ]; }; } diff --git a/options/custom/programs/swaylock.nix b/options/custom/programs/swaylock.nix index d44668e..6eb5642 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.settings.fonts.monospace; + font = config.stylix.fonts.monospace.name; image = mkIf config.custom.wallpaper "/tmp/altered.png"; bs-hl-color = "93a1a1"; color = "073642"; diff --git a/options/custom/programs/vscode.nix b/options/custom/programs/vscode.nix index c6638fd..af694a5 100644 --- a/options/custom/programs/vscode.nix +++ b/options/custom/programs/vscode.nix @@ -92,6 +92,13 @@ in { }; }; + # TODO: Use stylix + # https://stylix.danth.me/options/modules/vscode.html + stylix.targets.vscode = { + enable = false; + #// profileNames = ["default"]; + }; + xdg.configFile = with hm.lib.file; { # Imperative symlinks intended to be synced "VSCodium/User/settings.json" = { diff --git a/options/custom/programs/waybar/default.nix b/options/custom/programs/waybar/default.nix index 856a10b..71a5d35 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.settings.fonts.monospace; + font = config.stylix.fonts.monospace.name; gap = toString config.custom.gap; in '' * { @@ -496,6 +496,10 @@ in { }; }; }; + + # TODO: Use stylix + # https://stylix.danth.me/options/modules/waybar.html + stylix.targets.waybar.enable = false; } ]; }; diff --git a/options/custom/programs/wezterm/default.nix b/options/custom/programs/wezterm/default.nix index 0830eea..bc4910c 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.settings.fonts.monospace}') + config.font = wezterm.font('${config.stylix.fonts.monospace.name}') -- # TODO: Remove when using Wayland config.font_size = ${toString (14 * config.custom.scale)} diff --git a/options/custom/programs/zed.nix b/options/custom/programs/zed.nix index 1db78cb..b194e63 100644 --- a/options/custom/programs/zed.nix +++ b/options/custom/programs/zed.nix @@ -134,11 +134,11 @@ in { theme = { mode = "system"; - light = "Solarized Light"; - dark = "Solarized Dark"; + light = "NeoSolarized Light"; + dark = "NeoSolarized Dark"; }; - ui_font_family = config.custom.settings.fonts.sans-serif; + ui_font_family = config.stylix.fonts.sansSerif.name; ui_font_size = 20; # Language-specific @@ -223,6 +223,10 @@ in { }; }; }; + + # TODO: Use stylix + # https://stylix.danth.me/options/modules/zed.html + stylix.targets.zed.enable = false; } ]; }; diff --git a/options/custom/services/mako.nix b/options/custom/services/mako.nix index 562ea53..ba6a96d 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.settings.fonts.sans-serif} 12"; + font = "${config.stylix.fonts.monospace.name} 12"; layer = "overlay"; margin = "20"; padding = "10"; diff --git a/options/custom/settings/boot.nix b/options/custom/settings/boot.nix index c185c22..651e9c2 100644 --- a/options/custom/settings/boot.nix +++ b/options/custom/settings/boot.nix @@ -73,28 +73,5 @@ in { grub.enable = cfg.grub; }; }; - - console = mkIf config.custom.minimal { - # Modified Solarized Dark - # https://github.com/coderonline/base16-vtrgb/blob/master/consolecolors/base16-solarized-dark.hex - colors = [ - "073642" - "002b36" # Background - "859900" # Success - "657b83" - "839496" - "b58900" - "eee8d5" - "93a1a1" # Primary - "dc322f" - "cb4b16" - "d33682" # Tertiary - "586e75" - "6c71c4" # Accent - "268bd2" - "2aa198" - "fdf6e3" # Secondary - ]; - }; }; } diff --git a/options/custom/settings/dconf/apps.nix b/options/custom/settings/dconf/apps.nix index ea134a8..6ff76bd 100644 --- a/options/custom/settings/dconf/apps.nix +++ b/options/custom/settings/dconf/apps.nix @@ -66,14 +66,6 @@ in { show = false; }; - # GNOME - "org/gnome/desktop/interface" = { - cursor-blink = mkBoolean false; - gtk-enable-primary-paste = mkBoolean false; - color-scheme = mkString "prefer-dark"; - monospace-font-name = mkString "monospace 14"; - }; - # GNOME Files "org/gtk/settings/file-chooser" = { show-hidden = mkBoolean true; diff --git a/options/custom/settings/dconf/gnome.nix b/options/custom/settings/dconf/gnome.nix index 1c81d44..3625ced 100644 --- a/options/custom/settings/dconf/gnome.nix +++ b/options/custom/settings/dconf/gnome.nix @@ -15,12 +15,15 @@ in { }; "org/gnome/desktop/interface" = { + clock-format = mkString "12h"; clock-show-date = mkBoolean true; clock-show-seconds = mkBoolean false; clock-show-weekday = mkBoolean true; + #// color-scheme = mkString "prefer-dark"; + cursor-blink = mkBoolean false; enable-hot-corners = mkBoolean false; gtk-enable-primary-paste = mkBoolean false; - clock-format = mkString "12h"; + #// monospace-font-name = mkString "monospace 14"; }; "org/gnome/desktop/notifications" = { diff --git a/options/custom/settings/default.nix b/options/custom/settings/default.nix index 032de9e..4f763f0 100644 --- a/options/custom/settings/default.nix +++ b/options/custom/settings/default.nix @@ -17,10 +17,10 @@ with lib; { (mkIf config.custom.minimal { dconf.enable = true; - fonts.enable = true; - gtk.enable = true; - icons.enable = true; - qt.enable = true; + #// fonts.enable = true; + #// gtk.enable = true; + #// icons.enable = true; + #// qt.enable = true; stylix.enable = true; xdg.enable = true; }) diff --git a/options/custom/settings/stylix.nix b/options/custom/settings/stylix.nix index e5b2630..a8ce85c 100644 --- a/options/custom/settings/stylix.nix +++ b/options/custom/settings/stylix.nix @@ -6,20 +6,170 @@ }: with lib; let cfg = config.custom.settings.stylix; + hm = config.home-manager.users.${config.custom.username}; in { options.custom.settings.stylix = { enable = mkOption {default = false;}; }; config = mkIf cfg.enable { - # TODO: Use stylix for theming # https://stylix.danth.me/ + # https://stylix.danth.me/configuration.html stylix = { - # BUG: Assertion failure, set to true when merged - # https://github.com/danth/stylix/pull/912 - enable = false; + enable = true; + autoEnable = true; + # https://stylix.danth.me/configuration.html#color-scheme + # https://github.com/tinted-theming/schemes + # https://github.com/tinted-theming/schemes/blob/spec-0.11/base16/solarized-dark.yaml base16Scheme = "${pkgs.base16-schemes}/share/themes/solarized-dark.yaml"; + + # https://stylix.danth.me/configuration.html#overriding + # https://github.com/SenchoPens/base16.nix + override = {}; + + # https://stylix.danth.me/options/platforms/nixos.html#stylixpolarity + polarity = "dark"; + + # https://stylix.danth.me/options/platforms/nixos.html#stylixcursor + cursor = { + # https://github.com/ful1e5/Google_Cursor + name = "GoogleDot-Black"; + package = pkgs.google-cursor; + size = 24; + }; + + # https://stylix.danth.me/options/platforms/nixos.html#stylixfontsemoji + fonts = { + emoji = { + name = "Blobmoji"; + package = pkgs.noto-fonts-emoji-blob-bin; + }; + + monospace = { + name = "IosevkaTermSlab NFP Medium"; + package = pkgs.nerd-fonts.iosevka-term-slab; + }; + + sansSerif = { + name = "Arvo"; + package = pkgs.google-fonts; + }; + + serif = { + name = "Lora"; + package = pkgs.google-fonts; + }; + + # https://stylix.danth.me/options/platforms/nixos.html#stylixfontssizesapplications + sizes = { + applications = 12; + desktop = 12; + popups = 12; + terminal = 14; + }; + }; }; + + # Install packages to environment for imperative use + fonts.packages = with pkgs.nerd-fonts; + [ + # Monospace + # https://www.nerdfonts.com/#home + #?? kitten choose-fonts + departure-mono + gohufont + iosevka-term + iosevka-term-slab + jetbrains-mono + roboto-mono + shure-tech-mono + space-mono + zed-mono + ] + ++ (with pkgs; [ + (google-fonts.override { + fonts = [ + # Pixel + "Geo" + "Silkscreen" + + # Sans-serif + "Josefin Sans" + "Jost" + "Lexend" + "Outfit" + "Roboto" + "Roboto Flex" + + # Sans-serif condensed + "Oswald" + "Roboto Condensed" + + # Serif + "Lora" + "Roboto Serif" + + # Slab + "Aleo" + "Arvo" + "Josefin Slab" + "Roboto Slab" + "Solway" + ]; + }) + + # Emoji + noto-fonts-color-emoji + noto-fonts-emoji-blob-bin + + # Microsoft + corefonts + vistafonts + + # Fallback + unifont + ]); + + home-manager.sharedModules = [ + { + # https://stylix.danth.me/options/platforms/home_manager.html + stylix = { + # https://stylix.danth.me/options/platforms/home_manager.html#stylixiconthemedark + iconTheme = { + # BUG: GTK4 apps start slower with Papirus + # https://github.com/PapirusDevelopmentTeam/papirus-icon-theme/issues/3860 + # https://github.com/PapirusDevelopmentTeam/papirus-icon-theme + # https://github.com/vinceliuice/Tela-icon-theme + enable = true; + dark = "Tela-pink-dark"; + light = "Tela-pink-light"; + package = pkgs.tela-icon-theme; + }; + + #!! Accent colors are not the same globally, so override each target individually + # https://github.com/danth/stylix/issues/402 + targets = { + # TODO: Use gtksourceview target when merged + # https://github.com/danth/stylix/issues/954 + gnome-text-editor.enable = false; + + gtk.extraCss = '' + @define-color accent_color #d33682; + @define-color accent_bg_color #d33682; + @define-color window_bg_color #073642; + @define-color borders #073642; + @define-color unfocused_borders #073642; + ''; + }; + }; + + # BUG: home.pointerCursor breaks XCURSOR_PATH for some child windows, so avoid ${} bashism + # https://github.com/nix-community/home-manager/blob/59a4c43e9ba6db24698c112720a58a334117de83/modules/config/home-cursor.nix#L154 + home.sessionVariables = { + XCURSOR_PATH = "$XCURSOR_PATH:${hm.home.profileDirectory}/share/icons"; + }; + } + ]; }; }