dot

NixOS dotfiles
git clone https://git.echoz.io/dot.git
Log | Files | Refs

commit c0c674d6a0dad3010dec740c735e540f39447eeb
parent 90a45e13f377dee931e31008c158fa56f4ecf986
Author: Chris <chris@echoz.io>
Date:   Thu, 20 Nov 2025 07:33:49 +0100

feat(style): update colors and fonts and keep them in one place

Diffstat:
Mmodules/dunst/default.nix | 21+++++++++++----------
Mmodules/firefox/default.nix | 4++--
Dmodules/firefox/userChrome.css | 64----------------------------------------------------------------
Amodules/firefox/userChrome.css.nix | 66++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Amodules/fonts/default.nix | 39+++++++++++++++++++++++++++++++++++++++
Mmodules/greetd/default.nix | 5+++--
Mmodules/hypr/hyprland.nix | 19+++++++------------
Mmodules/hypr/hyprlock.nix | 3++-
Mmodules/hypr/hyprpaper.nix | 12+++---------
Mmodules/kitty/default.nix | 23++++++++++++++++++-----
Mmodules/plymouth/default.nix | 7++-----
Amodules/style/color-helper.nix | 26++++++++++++++++++++++++++
Amodules/style/default.nix | 86+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Rmodules/hypr/wallpaper.jpg -> modules/style/wallpaper.jpg | 0
Mmodules/walker/default.nix | 11++++-------
Mmodules/waybar/default.nix | 57++++++++++++++++++++++++++++++++++++++++++++++++---------
Dmodules/waybar/style.css | 44--------------------------------------------
Mmodules/wayprompt/default.nix | 41++++++++++++++++++++---------------------
Mmodules/zathura/default.nix | 16++++++++--------
19 files changed, 345 insertions(+), 199 deletions(-)

diff --git a/modules/dunst/default.nix b/modules/dunst/default.nix @@ -1,6 +1,7 @@ { pkgs, + style, user, ... }: @@ -30,7 +31,7 @@ frame_width = 0; markup = "full"; icon_position = "off"; - font = "JetBrains Mono Nerd Font Propo 12"; + font = "${style.fonts.mono.family} 12"; line_height = 12; stack_duplicates = true; hide_duplicate_count = true; @@ -42,23 +43,23 @@ urgency_low = { timeout = 3; - background = "#00000033"; - foreground = "#eeeeee"; - frame_color = "#eeeeee"; + background = "#${style.colors.bg.hexRgba}"; + foreground = "#${style.colors.fg.hex}"; + frame_color = "#${style.colors.fg.hex}"; }; urgency_normal = { timeout = 3; - background = "#00000033"; - foreground = "#eeeeee"; - frame_color = "#eeeeee"; + background = "#${style.colors.bg.hexRgba}"; + foreground = "#${style.colors.fg.hex}"; + frame_color = "#${style.colors.fg.hex}"; }; urgency_critical = { timeout = 30; - background = "#00000033"; - foreground = "#eeeeee"; - frame_color = "#eeee00"; + background = "#${style.colors.bg.hexRgba}"; + foreground = "#${style.colors.fg.hex}"; + frame_color = "#${style.colors.red.hex}"; }; }; }; diff --git a/modules/firefox/default.nix b/modules/firefox/default.nix @@ -1,4 +1,4 @@ -{ user, ... }: +{ style, user, ... }: { imports = [ ./policies.nix @@ -36,7 +36,7 @@ }; extraConfig = builtins.readFile ./user.js; - userChrome = builtins.readFile ./userChrome.css; + userChrome = import ./userChrome.css.nix style; }; }; }; diff --git a/modules/firefox/userChrome.css b/modules/firefox/userChrome.css @@ -1,64 +0,0 @@ -@-moz-document url(chrome://browser/content/browser.xul), url(chrome://browser/content/browser.xhtml) { - #browser { - background-color: rgba(0,0,0,0.2) !important; - } - - #navigator-toolbox { - background-color: rgba(0,0,0,0.2) !important; - border-bottom: none !important; - } - - #firefox-view-button, - toolbarbutton.titlebar-close, - toolbarspring, - toolbarbutton#alltabs-button, - #urlbar-searchmode-switcher, - /* #unified-extensions-button, */ - image.tab-close-button.close-icon, - toolbarbutton#tabs-newtab-button, - splitter#sidebar-tools-and-extensions-splitter, - .titlebar-spacer { - display: none !important; - } - - #urlbar hbox.urlbar-background, - toolbar#nav-bar { - background: transparent !important; - } - - #urlbar[breakout-extend] hbox.urlbar-background { - background: #222 !important; - } - - tabs#tabbrowser-tabs { - border-inline-start: none !important; - } - - - .tabbrowser-tab:hover > .tab-stack > &:not([selected], [multiselected]) { - background-color: rgba(0,0,0,0.2) !important; - } - - .tab-background { - &:is([selected], [multiselected]) { - background-color: rgba(255,255,255,0.1) !important; - } - } - - toolbaritem#ublock0_raymondhill_net-browser-action image.toolbarbutton-icon { - filter: grayscale(100%) invert(100%); - } - - toolbaritem#_446900e4-71c2-419f-a6a7-df9c091e268b_-browser-action image.toolbarbutton-icon, - button[title="Bitwarden"] img { - filter: grayscale(100%) invert(100%) contrast(200%); - } - - toolbaritem#addon_darkreader_org-browser-action image.toolbarbutton-icon { - filter: grayscale(100%) invert(100%) contrast(250%); - } - - stack.tab-icon-stack { - display: none; - } -} diff --git a/modules/firefox/userChrome.css.nix b/modules/firefox/userChrome.css.nix @@ -0,0 +1,66 @@ +style: '' + @-moz-document url(chrome://browser/content/browser.xul), url(chrome://browser/content/browser.xhtml) { + #browser { + background-color: ${style.colors.bg.rgba} !important; + } + + #navigator-toolbox { + background-color: ${style.colors.bg.rgba} !important; + border-bottom: none !important; + } + + #firefox-view-button, + toolbarbutton.titlebar-close, + toolbarspring, + toolbarbutton#alltabs-button, + #urlbar-searchmode-switcher, + /* #unified-extensions-button, */ + image.tab-close-button.close-icon, + toolbarbutton#tabs-newtab-button, + splitter#sidebar-tools-and-extensions-splitter, + .titlebar-spacer { + display: none !important; + } + + #urlbar hbox.urlbar-background, + toolbar#nav-bar { + background: transparent !important; + } + + #urlbar[breakout-extend] hbox.urlbar-background { + background: #${style.colors.hibg.hex} !important; + } + + tabs#tabbrowser-tabs { + border-inline-start: none !important; + } + + + .tabbrowser-tab:hover > .tab-stack > &:not([selected], [multiselected]) { + background-color: ${style.colors.bg.rgba} !important; + } + + .tab-background { + &:is([selected], [multiselected]) { + background-color: ${style.colors.bg.rgba} !important; + } + } + + toolbaritem#ublock0_raymondhill_net-browser-action image.toolbarbutton-icon { + filter: grayscale(100%) invert(100%); + } + + toolbaritem#_446900e4-71c2-419f-a6a7-df9c091e268b_-browser-action image.toolbarbutton-icon, + button[title="Bitwarden"] img { + filter: grayscale(100%) invert(100%) contrast(200%); + } + + toolbaritem#addon_darkreader_org-browser-action image.toolbarbutton-icon { + filter: grayscale(100%) invert(100%) contrast(250%); + } + + stack.tab-icon-stack { + display: none; + } + } +'' diff --git a/modules/fonts/default.nix b/modules/fonts/default.nix @@ -0,0 +1,39 @@ +{ + lib, + pkgs, + + style, + user, + ... +}: +{ + fonts = { + fontconfig = { + subpixel = { + rgba = lib.mkDefault "rgb"; + lcdfilter = "default"; + }; + + hinting.style = "slight"; + + defaultFonts = { + monospace = [ style.fonts.mono.family ]; + sansSerif = [ style.fonts.sansSerif.family ]; + serif = [ style.fonts.serif.family ]; + emoji = [ style.fonts.emoji.family ]; + }; + }; + + packages = [ + style.fonts.mono.package + style.fonts.sansSerif.package + style.fonts.serif.package + style.fonts.emoji.package + pkgs.corefonts + ]; + }; + + home-manager.users.${user}.dconf.settings = { + "org/gnome/desktop/interface".font-antialiasing = "rgba"; + }; +} diff --git a/modules/greetd/default.nix b/modules/greetd/default.nix @@ -3,6 +3,7 @@ config, pkgs, + style, user, home-manager, @@ -28,13 +29,13 @@ exec-once = [ "${lib.getExe pkgs.gtkgreet} -s ${pkgs.writeText "greetd-style.css" '' window, button, entry { - background: rgba(0,0,0,0.2); + background: ${style.colors.bg.rgba}; border: none; box-shadow: none; text-shadow: none; } label, window, button, entry { - color: #eee; + color: #${style.colors.fg.hex}; } #command-selector arrow { opacity: 0; diff --git a/modules/hypr/hyprland.nix b/modules/hypr/hyprland.nix @@ -1,7 +1,7 @@ { lib, - pkgs, + style, user, ... }: @@ -33,19 +33,14 @@ gaps_in = 5; gaps_out = 20; border_size = 2; - "col.active_border" = "rgba(00000000) rgba(ffffffff) rgba(00000000) 45deg"; + "col.active_border" = "rgba(00000000) ${style.colors.fg.rgbaHex} rgba(00000000) 45deg"; "col.inactive_border" = "rgba(00000000)"; layout = "dwindle"; }; decoration = { rounding = 10; - shadow = { - enabled = false; - range = 4; - render_power = 3; - color = "rgba(1a1a1aee)"; - }; + shadow.enabled = false; blur = { enabled = true; size = 9; @@ -86,9 +81,9 @@ group = { drag_into_group = 2; merge_groups_on_drag = false; - "col.border_active" = "rgba(00000000) rgba(ffffffff) rgba(00000000) 45deg"; + "col.border_active" = "rgba(00000000) ${style.colors.fg.rgbaHex} rgba(00000000) 45deg"; "col.border_inactive" = "rgba(00000000)"; - "col.border_locked_active" = "rgba(00000000) rgba(ffffffff) rgba(00000000) 45deg"; + "col.border_locked_active" = "rgba(00000000) ${style.colors.fg.rgbaHex} rgba(00000000) 45deg"; "col.border_locked_inactive" = "rgba(00000000)"; groupbar = { @@ -97,8 +92,8 @@ gaps_out = 5; indicator_height = 4; rounding = 2; - "col.active" = "rgba(ffffffff)"; - "col.inactive" = "rgba(999999ff)"; + "col.active" = style.colors.fg.rgbaHex; + "col.inactive" = style.colors.lo.rgbaHex; }; }; diff --git a/modules/hypr/hyprlock.nix b/modules/hypr/hyprlock.nix @@ -1,4 +1,5 @@ { + style, user, ... }: @@ -25,7 +26,7 @@ dots_center = false; fade_on_empty = true; font_color = "rgba(255, 255, 255, 0.2)"; - inner_color = "rgba(0,0,0,0.2)"; + inner_color = style.colors.bg.rgba; check_color = "rgba(0,0,255,0.2)"; fail_color = "rgba(255,0,0,0.2)"; fail_text = ""; diff --git a/modules/hypr/hyprpaper.nix b/modules/hypr/hyprpaper.nix @@ -1,18 +1,12 @@ -{ - lib, - config, - - user, - ... -}: +{ style, user, ... }: { config = { home-manager.users.${user}.services.hyprpaper = { enable = true; settings = { - preload = [ "${./wallpaper.jpg}" ]; - wallpaper = [ ",${./wallpaper.jpg}" ]; + preload = [ style.wallpaper ]; + wallpaper = [ ",${style.wallpaper}" ]; }; }; }; diff --git a/modules/kitty/default.nix b/modules/kitty/default.nix @@ -1,8 +1,8 @@ { lib, - config, pkgs, + style, user, ... }: @@ -13,17 +13,30 @@ programs.kitty = { enable = true; font = { - name = "JetBrains Mono Nerd Font Mono"; + name = style.fonts.mono.family; size = 12; package = pkgs.nerd-fonts.jetbrains-mono; }; settings = { - background = "#000000"; - background_opacity = 0.2; window_padding_width = 10; disable_ligatures = false; confirm_os_window_close = 0; - }; + } + // (with style.colors; { + foreground = "#${fg.hex}"; + background = "#${bg.hex}"; + background_opacity = bg.a; + selection_foreground = "#${bg.hex}"; + selection_background = "#${fg.hex}"; + + cursor = "#${fg.hex}"; + cursor_text_color = "#${bg.hex}"; + + url_color = "#${url.hex}"; + }) + // builtins.mapAttrs (_: c: "#${c.hex}") ( + lib.getAttrs (builtins.genList (n: "color${builtins.toString n}") 16) style.colors + ); }; }; } diff --git a/modules/plymouth/default.nix b/modules/plymouth/default.nix @@ -1,10 +1,7 @@ -{ - pkgs, - ... -}: +{ style, ... }: { config.boot.plymouth = { enable = true; - font = "${pkgs.nerd-fonts.jetbrains-mono}/share/fonts/truetype/NerdFonts/JetBrainsMono/JetBrainsMonoNerdFontPropo-Regular.ttf"; + font = style.fonts.mono.ttf; }; } diff --git a/modules/style/color-helper.nix b/modules/style/color-helper.nix @@ -0,0 +1,26 @@ +lib: r: g: b: a: +let + s = builtins.toString; + toUnsignedInt = n: lib.toInt (builtins.head (builtins.match "^([0-9]*).*$" (builtins.toString n))); + toHex = n: builtins.head (builtins.match "^.*(.{2})$" "0${lib.toHexString (toUnsignedInt n)}"); + xr = toHex r; + xg = toHex g; + xb = toHex b; + xa = toHex (a * 255); +in +{ + inherit + r + g + b + a + xr + xg + xb + xa + ; + rgba = "rgba(${s r},${s g},${s b},${s a})"; + rgbaHex = "rgba(${xr}${xg}${xb}${xa})"; + hex = "${xr}${xg}${xb}"; + hexRgba = "${xr}${xg}${xb}${xa}"; +} diff --git a/modules/style/default.nix b/modules/style/default.nix @@ -0,0 +1,86 @@ +{ lib, pkgs, ... }: +let + color = import ./color-helper.nix lib; +in +{ + _module.args.style = { + wallpaper = builtins.toString ./wallpaper.jpg; + + fonts = { + mono = rec { + family = "JetBrains Mono Nerd Font Propo"; + package = pkgs.nerd-fonts.jetbrains-mono; + ttf = "${package}/share/fonts/truetype/NerdFonts/JetBrainsMono/JetBrainsMonoNerdFontPropo-Regular.ttf"; + }; + + sansSerif = rec { + family = "Open Sans"; + package = pkgs.open-sans; + ttf = "${package}/share/fonts/truetype/OpenSans-Regular.ttf"; + }; + + serif = rec { + family = "Roboto Slab"; + package = pkgs.roboto-slab; + ttf = "${package}/share/fonts/truetype/RobotoSlab-Regular.ttf"; + }; + + emoji = rec { + family = "Noto Color Emoji"; + package = pkgs.noto-fonts-color-emoji; + ttf = "${package}/share/fonts/noto/NotoColorEmoji.ttf"; + }; + }; + + colors = rec { + bg = color 0 0 0 0.2; + fg = color 216 222 233 1; + lo = color 67 76 94 1; + hi = bg; + hibg = color 46 52 64 1; + url = color 0 135 189 1; + + black = color 59 66 82 1; + brBlack = color 76 86 106 1; + + red = color 191 97 106 1; + brRed = red; + + green = color 163 190 140 1; + brGreen = green; + + yellow = color 235 203 139 1; + brYellow = color 208 135 112 1; + + blue = color 129 161 193 1; + brBlue = color 94 129 172 1; + + magenta = color 180 142 173 1; + brMagenta = magenta; + + cyan = color 136 192 208 1; + brCyan = color 143 188 187 1; + + white = color 229 233 240 1; + brWhite = color 236 239 244 1; + + color0 = black; + color1 = red; + color2 = green; + color3 = yellow; + color4 = blue; + color5 = magenta; + color6 = cyan; + color7 = white; + + color8 = brBlack; + color9 = brRed; + color10 = brGreen; + color11 = brYellow; + color12 = brBlue; + color13 = brMagenta; + color14 = brCyan; + color15 = brWhite; + }; + }; +} diff --git a/modules/hypr/wallpaper.jpg b/modules/style/wallpaper.jpg Binary files differ. diff --git a/modules/walker/default.nix b/modules/walker/default.nix @@ -1,9 +1,6 @@ { - lib, - config, - + style, user, - walker, ... }: @@ -41,8 +38,8 @@ background: none; border: none; box-shadow: none; - color: #eee; - font-family: JetBrains Mono Nerd Font Propo; + color: #${style.colors.fg.hex}; + font-family: ${style.fonts.mono.family}; font-size: 12pt; outline: none; } @@ -50,7 +47,7 @@ .box-wrapper { padding: 20px; border-radius: 20px; - background: rgba(0,0,0,0.2); + background: ${style.colors.bg.rgba}; } ''; }; diff --git a/modules/waybar/default.nix b/modules/waybar/default.nix @@ -1,10 +1,4 @@ -{ - lib, - config, - - user, - ... -}: +{ style, user, ... }: { home-manager.users.${user} = { wayland.windowManager.hyprland.settings.layerrule = [ "blur,waybar" ]; @@ -13,8 +7,6 @@ enable = true; systemd.enable = true; - style = builtins.readFile ./style.css; - settings = { mainBar = { layer = "top"; @@ -90,6 +82,53 @@ }; }; }; + + style = '' + * { + border: none; + border-radius: 0; + font-family: ${style.fonts.mono.family}; + font-size: 12pt; + } + + window#waybar { + border: none; + color: #${style.colors.fg.hex}; + background: ${style.colors.bg.rgba}; + } + + .modules-right > widget > *, #window { + padding: 0 10px; + } + + .modules-center > widget > * { + padding: 0 10px; + } + + #tray { + padding: 0; + padding-right: 10px; + } + + #workspaces button { + color: #${style.colors.fg.hex}; + transition: box-shadow 0.1s linear; + } + + #workspaces button:hover { + background: inherit; + box-shadow: inset 0px 2px #${style.colors.lo.hex}; + text-shadow: inherit; + } + + #workspaces button.active { + box-shadow: inset 0px 2px #${style.colors.bg.hex}; + } + + #workspaces button.empty { + color: #${style.colors.lo.hex}; + } + ''; }; }; } diff --git a/modules/waybar/style.css b/modules/waybar/style.css @@ -1,44 +0,0 @@ -* { - border: none; - border-radius: 0; - font-family: JetBrains Mono Nerd Font Propo; - font-size: 12pt; -} - -window#waybar { - border: none; - color: #fff; - background: rgba(0,0,0,0.2); -} - -.modules-right > widget > *, #window { - padding: 0 10px; -} - -.modules-center > widget > * { - padding: 0 10px; -} - -#tray { - padding: 0; - padding-right: 10px; -} - -#workspaces button { - color: #fff; - transition: box-shadow 0.1s linear; -} - -#workspaces button:hover { - background: inherit; - box-shadow: inset 0px 2px #777; - text-shadow: inherit; -} - -#workspaces button.active { - box-shadow: inset 0px 2px #fff; -} - -#workspaces button.empty { - color: #777; -} diff --git a/modules/wayprompt/default.nix b/modules/wayprompt/default.nix @@ -1,6 +1,5 @@ { - lib, - + style, user, ... }: @@ -16,34 +15,34 @@ settings = { general = { - font-regular = "JetBrains Mono Nerd Font Propo:size=12"; - font-large = "JetBrains Mono Nerd Font Propo:size=24"; + font-regular = "${style.fonts.mono.family}:size=12"; + font-large = "${style.fonts.mono.family}:size=24"; corner-radius = 10; border = 0; pin-square-amount = 32; }; - colours = { - background = "00000033"; - border = "00000033"; - text = "ffffffff"; - error-text = "ffffffff"; + colours = with style.colors; { + background = bg.hexRgba; + border = bg.hexRgba; + text = fg.hexRgba; + error-text = fg.hexRgba; - pin-background = "00000033"; - pin-border = "eeeeeeff"; - pin-square = "eeeeeeff"; + pin-background = bg.hexRgba; + pin-border = fg.hexRgba; + pin-square = fg.hexRgba; - ok-button = "00000033"; - ok-button-border = "eeeeeeff"; - ok-button-text = "eeeeeeff"; + ok-button = bg.hexRgba; + ok-button-border = fg.hexRgba; + ok-button-text = fg.hexRgba; - not-ok-button = "00000033"; - not-ok-button-border = "eeeeeeff"; - not-ok-button-text = "eeeeeeff"; + not-ok-button = bg.hexRgba; + not-ok-button-border = fg.hexRgba; + not-ok-button-text = fg.hexRgba; - cancel-button = "00000033"; - cancel-button-border = "eeeeeeff"; - cancel-button-text = "eeeeeeff"; + cancel-button = bg.hexRgba; + cancel-button-border = fg.hexRgba; + cancel-button-text = fg.hexRgba; }; }; }; diff --git a/modules/zathura/default.nix b/modules/zathura/default.nix @@ -1,4 +1,4 @@ -{ user, ... }: +{ style, user, ... }: { home-manager.users.${user}.programs.zathura = { enable = true; @@ -9,13 +9,13 @@ l = "feedkeys <C-Right>"; }; - options = { - font = "JetBrains Mono Nerd Font Propo 12"; - default-fg = "rgba(255,255,255,1)"; - default-bg = "rgba(0,0,0,0.2)"; - statusbar-bg = "rgba(0,0,0,0)"; - inputbar-bg = "rgba(0,0,0,0)"; - completion-bg = "rgba(0,0,0,0)"; + options = with style; { + font = "${fonts.mono.family} 12"; + default-fg = colors.fg.rgba; + default-bg = colors.bg.rgba; + statusbar-bg = colors.bg.rgba; + inputbar-bg = colors.bg.rgba; + completion-bg = colors.bg.rgba; }; }; }