From bcc674f1994396137438bac9d905971453d33b12 Mon Sep 17 00:00:00 2001 From: awwpotato <153149335+awwpotato@users.noreply.github.com> Date: Sat, 15 Mar 2025 05:09:19 -0700 Subject: [PATCH 01/62] stylix: simplify autoload.nix (#1001) --- stylix/autoload.nix | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/stylix/autoload.nix b/stylix/autoload.nix index c549e42f..98fb8f5d 100644 --- a/stylix/autoload.nix +++ b/stylix/autoload.nix @@ -6,12 +6,9 @@ for: builtins.concatLists ( lib.mapAttrsToList ( path: kind: - if kind == "directory" then - let - file = "${inputs.self}/modules/${path}/${for}.nix"; - in - if builtins.pathExists file then [ file ] else [ ] - else - [ ] + let + file = "${inputs.self}/modules/${path}/${for}.nix"; + in + lib.optional (kind == "directory" && builtins.pathExists file) file ) (builtins.readDir "${inputs.self}/modules") ) From fa288c0dc695b49c9af38614af8da981371fe92a Mon Sep 17 00:00:00 2001 From: NAHO <90870942+trueNAHO@users.noreply.github.com> Date: Mon, 17 Mar 2025 19:01:50 +0100 Subject: [PATCH 02/62] doc: fix testbed names (#1013) --- README.md | 2 +- docs/src/testbeds.md | 16 +++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index fee0a287..8b1adc2c 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ philosophy. Try a live demo of this dark theme by running: ```console -nix run github:danth/stylix#testbed:gnome:default:dark:image:scheme +nix run github:danth/stylix#testbed:gnome:default:dark:image:scheme:cursor ``` ### KDE Plasma 5 diff --git a/docs/src/testbeds.md b/docs/src/testbeds.md index cbaa89b1..03ea0a6a 100644 --- a/docs/src/testbeds.md +++ b/docs/src/testbeds.md @@ -52,10 +52,16 @@ github:danth/stylix └───x86_64-linux ├───docs: package 'stylix-book' ├───palette-generator: package 'palette-generator' - ├───testbed:gnome:default:dark: package 'testbed:gnome:default:dark' - ├───testbed:gnome:default:light: package 'testbed:gnome:default:light' - ├───testbed:kde:default:dark: package 'testbed:kde:default:dark' - └───testbed:kde:default:light: package 'testbed:kde:default:light' + ├───"testbed:gnome:default:dark:image:scheme:cursor": package 'testbed-gnome-default-dark-image-scheme-cursor' + ├───"testbed:gnome:default:dark:image:scheme:cursorless": package 'testbed-gnome-default-dark-image-scheme-cursorless' + ├───"testbed:gnome:default:dark:image:schemeless:cursorless": package 'testbed-gnome-default-dark-image-schemeless-cursorless' + ├───"testbed:gnome:default:dark:imageless:scheme:cursorless": package 'testbed-gnome-default-dark-imageless-scheme-cursorless' + ├───"testbed:gnome:default:light:image:scheme:cursorless": package 'testbed-gnome-default-light-image-scheme-cursorless' + ├───"testbed:kde:default:dark:image:scheme:cursor": package 'testbed-kde-default-dark-image-scheme-cursor' + ├───"testbed:kde:default:dark:image:scheme:cursorless": package 'testbed-kde-default-dark-image-scheme-cursorless' + ├───"testbed:kde:default:dark:image:schemeless:cursorless": package 'testbed-kde-default-dark-image-schemeless-cursorless' + ├───"testbed:kde:default:dark:imageless:scheme:cursorless": package 'testbed-kde-default-dark-imageless-scheme-cursorless' + └───"testbed:kde:default:light:image:scheme:cursorless": package 'testbed-kde-default-light-image-scheme-cursorless' ``` (This has been edited down to only the relevant parts.) @@ -64,7 +70,7 @@ To start a testbed, each of which is named in the format `testbed:«module»:«testbed»:«polarity»`, run the following command: ```console -user@host:~$ nix run .#testbed:«module»:«testbed»:«polarity» +user@host:~$ nix run .#testbed:«module»:«testbed»:«polarity»:«image»:«scheme»:«cursor» ``` Any package with a name not fitting the given format is not a testbed, From ff9ae322bcaeccabc65812390000276455331123 Mon Sep 17 00:00:00 2001 From: awwpotato <153149335+awwpotato@users.noreply.github.com> Date: Tue, 18 Mar 2025 05:10:02 -0700 Subject: [PATCH 03/62] treewide: clean up `with` and stuff (#975) Fixes #973 --- modules/avizo/hm.nix | 10 +- modules/bemenu/hm.nix | 59 ++--- modules/bspwm/hm.nix | 17 +- modules/btop/hm.nix | 95 ++++---- modules/console/nixos.nix | 41 ++-- modules/discord/hm.nix | 10 +- modules/dunst/hm.nix | 7 +- modules/emacs/hm.nix | 86 +++---- modules/foot/hm.nix | 8 +- modules/fuzzel/hm.nix | 6 +- modules/grub/nixos.nix | 155 ++++++------ modules/hyprlock/hm.nix | 11 +- modules/i3/hm.nix | 165 +++++++------ modules/i3status-rust/hm.nix | 35 ++- modules/k9s/hm.nix | 5 +- modules/kubecolor/hm.nix | 78 +++---- modules/mako/hm.nix | 42 ++-- modules/mangohud/hm.nix | 4 +- modules/ncspot/hm.nix | 48 ++-- modules/nixos-icons/nixos.nix | 5 +- modules/nushell/hm.nix | 79 +++---- modules/qutebrowser/hm.nix | 427 +++++++++++++++++----------------- modules/rio/hm.nix | 5 +- modules/rofi/hm.nix | 5 +- modules/sway/hm.nix | 175 +++++++------- modules/swaylock/hm.nix | 20 +- modules/swaync/hm.nix | 6 +- modules/tofi/hm.nix | 4 +- modules/vscode/hm.nix | 2 - modules/wezterm/hm.nix | 9 +- modules/wofi/hm.nix | 57 +++-- 31 files changed, 802 insertions(+), 874 deletions(-) diff --git a/modules/avizo/hm.nix b/modules/avizo/hm.nix index 7ad1517f..7f831b0a 100644 --- a/modules/avizo/hm.nix +++ b/modules/avizo/hm.nix @@ -4,12 +4,6 @@ options, ... }: - -with config.lib.stylix.colors; -with config.stylix.fonts; -let - aviOpacity = toString config.stylix.opacity.popups; -in { options.stylix.targets.avizo.enable = config.lib.stylix.mkEnableTarget "Avizo" true; @@ -19,12 +13,12 @@ in lib.mkIf (config.stylix.enable && config.stylix.targets.avizo.enable) { services.avizo = { settings = { - default = { + default = with config.lib.stylix.colors; { background = "rgba(${base01-rgb-r}, ${base01-rgb-g}, ${base01-rgb-b}, ${aviOpacity})"; border-color = "rgba(${base0D-rgb-r}, ${base0D-rgb-g}, ${base0D-rgb-b}, ${aviOpacity})"; bar-fg-color = "rgba(${base05-rgb-r}, ${base05-rgb-g}, ${base05-rgb-b}, ${aviOpacity})"; bar-bg-color = "rgba(${base01-rgb-r}, ${base01-rgb-g}, ${base01-rgb-b}, ${aviOpacity})"; - image-opacity = aviOpacity; + image-opacity = toString config.stylix.opacity.popups; }; }; }; diff --git a/modules/bemenu/hm.nix b/modules/bemenu/hm.nix index 1b2e97ab..b5fc2663 100644 --- a/modules/bemenu/hm.nix +++ b/modules/bemenu/hm.nix @@ -1,12 +1,4 @@ { config, lib, ... }: - -with config.lib.stylix.colors.withHashtag; -with config.stylix.fonts; -let - bemenuOpacity = lib.toHexString ( - ((builtins.ceil (config.stylix.opacity.popups * 100)) * 255) / 100 - ); -in { options.stylix.targets.bemenu = { enable = config.lib.stylix.mkEnableTarget "bemenu" true; @@ -16,7 +8,7 @@ in Font size used for bemenu. ''; type = with lib.types; nullOr int; - default = sizes.popups; + default = config.stylix.fonts.sizes.popups; }; # optional argument alternate = lib.mkOption { @@ -31,28 +23,37 @@ in config = lib.mkIf (config.stylix.enable && config.stylix.targets.bemenu.enable) { - programs.bemenu.settings = with config.stylix.targets.bemenu; { - tb = "${base01}${bemenuOpacity}"; # Title bg - nb = "${base01}${bemenuOpacity}"; # Normal bg - fb = "${base01}${bemenuOpacity}"; # Filter bg - hb = "${base03}${bemenuOpacity}"; # Highlighted bg - sb = "${base03}${bemenuOpacity}"; # Selected bg - scb = "${base01}"; # Scrollbar bg + programs.bemenu.settings = + with config.lib.stylix.colors.withHashtag; + with config.stylix.fonts; + with config.stylix.targets.bemenu; + let + bemenuOpacity = lib.toHexString ( + ((builtins.ceil (config.stylix.opacity.popups * 100)) * 255) / 100 + ); + in + { + tb = "${base01}${bemenuOpacity}"; # Title bg + nb = "${base01}${bemenuOpacity}"; # Normal bg + fb = "${base01}${bemenuOpacity}"; # Filter bg + hb = "${base03}${bemenuOpacity}"; # Highlighted bg + sb = "${base03}${bemenuOpacity}"; # Selected bg + scb = "${base01}"; # Scrollbar bg - hf = "${base0A}"; # Highlighted fg - sf = "${base0B}"; # Selected fg - tf = "${base05}"; # Title fg - ff = "${base05}"; # Filter fg - nf = "${base05}"; # Normal fg - scf = "${base03}"; # Scrollbar fg + hf = "${base0A}"; # Highlighted fg + sf = "${base0B}"; # Selected fg + tf = "${base05}"; # Title fg + ff = "${base05}"; # Filter fg + nf = "${base05}"; # Normal fg + scf = "${base03}"; # Scrollbar fg - ab = "${if alternate then base00 else base01}"; # Alternate bg - af = "${if alternate then base04 else base05}"; # Alternate fg + ab = "${if alternate then base00 else base01}"; # Alternate bg + af = "${if alternate then base04 else base05}"; # Alternate fg - # Font name - fn = "${sansSerif.name} ${ - lib.optionalString (fontSize != null) (builtins.toString fontSize) - }"; - }; + # Font name + fn = "${sansSerif.name} ${ + lib.optionalString (fontSize != null) (builtins.toString fontSize) + }"; + }; }; } diff --git a/modules/bspwm/hm.nix b/modules/bspwm/hm.nix index 36d360d0..2df8691a 100644 --- a/modules/bspwm/hm.nix +++ b/modules/bspwm/hm.nix @@ -1,18 +1,15 @@ { config, lib, ... }: - -let - colors = config.lib.stylix.colors.withHashtag; -in { options.stylix.targets.bspwm.enable = config.lib.stylix.mkEnableTarget "bspwm" true; config = lib.mkIf (config.stylix.enable && config.stylix.targets.bspwm.enable) { - xsession.windowManager.bspwm.settings = { - normal_border_color = colors.base03; - active_border_color = colors.base0C; - focused_border_color = colors.base0D; - presel_feedback_color = colors.base00; - }; + xsession.windowManager.bspwm.settings = + with config.lib.stylix.colors.withHashtag; { + normal_border_color = base03; + active_border_color = base0C; + focused_border_color = base0D; + presel_feedback_color = base00; + }; }; } diff --git a/modules/btop/hm.nix b/modules/btop/hm.nix index 0a722230..fc7d265e 100644 --- a/modules/btop/hm.nix +++ b/modules/btop/hm.nix @@ -1,8 +1,4 @@ { config, lib, ... }: - -let - colors = config.lib.stylix.colors.withHashtag; -in { options.stylix.targets.btop.enable = config.lib.stylix.mkEnableTarget "btop" true; @@ -21,50 +17,51 @@ in theme_background = lib.mkIf (config.stylix.opacity.terminal != 1.0) false; }; - xdg.configFile."btop/themes/stylix.theme".text = with colors; '' - #Generated by Stylix - theme[main_bg]="${base00}" - theme[main_fg]="${base05}" - theme[title]="${base05}" - theme[hi_fg]="${base0D}" - theme[selected_bg]="${base03}" - theme[selected_fg]="${base0D}" - theme[inactive_fg]="${base04}" - theme[graph_text]="${base06}" - theme[meter_bg]="${base03}" - theme[proc_misc]="${base06}" - theme[cpu_box]="${base0E}" - theme[mem_box]="${base0B}" - theme[net_box]="${base0C}" - theme[proc_box]="${base0D}" - theme[div_line]="${base01}" - theme[temp_start]="${base0B}" - theme[temp_mid]="${base0A}" - theme[temp_end]="${base08}" - theme[cpu_start]="${base0B}" - theme[cpu_mid]="${base0A}" - theme[cpu_end]="${base08}" - theme[free_start]="${base0A}" - theme[free_mid]="${base0B}" - theme[free_end]="${base0B}" - theme[cached_start]="${base0C}" - theme[cached_mid]="${base0C}" - theme[cached_end]="${base0A}" - theme[available_start]="${base08}" - theme[available_mid]="${base0A}" - theme[available_end]="${base0B}" - theme[used_start]="${base0A}" - theme[used_mid]="${base09}" - theme[used_end]="${base08}" - theme[download_start]="${base0B}" - theme[download_mid]="${base0A}" - theme[download_end]="${base08}" - theme[upload_start]="${base0B}" - theme[upload_mid]="${base0A}" - theme[upload_end]="${base08}" - theme[process_start]="${base0B}" - theme[process_mid]="${base0A}" - theme[process_end]="${base08}" - ''; + xdg.configFile."btop/themes/stylix.theme".text = + with config.lib.stylix.colors.withHashtag; '' + #Generated by Stylix + theme[main_bg]="${base00}" + theme[main_fg]="${base05}" + theme[title]="${base05}" + theme[hi_fg]="${base0D}" + theme[selected_bg]="${base03}" + theme[selected_fg]="${base0D}" + theme[inactive_fg]="${base04}" + theme[graph_text]="${base06}" + theme[meter_bg]="${base03}" + theme[proc_misc]="${base06}" + theme[cpu_box]="${base0E}" + theme[mem_box]="${base0B}" + theme[net_box]="${base0C}" + theme[proc_box]="${base0D}" + theme[div_line]="${base01}" + theme[temp_start]="${base0B}" + theme[temp_mid]="${base0A}" + theme[temp_end]="${base08}" + theme[cpu_start]="${base0B}" + theme[cpu_mid]="${base0A}" + theme[cpu_end]="${base08}" + theme[free_start]="${base0A}" + theme[free_mid]="${base0B}" + theme[free_end]="${base0B}" + theme[cached_start]="${base0C}" + theme[cached_mid]="${base0C}" + theme[cached_end]="${base0A}" + theme[available_start]="${base08}" + theme[available_mid]="${base0A}" + theme[available_end]="${base0B}" + theme[used_start]="${base0A}" + theme[used_mid]="${base09}" + theme[used_end]="${base08}" + theme[download_start]="${base0B}" + theme[download_mid]="${base0A}" + theme[download_end]="${base08}" + theme[upload_start]="${base0B}" + theme[upload_mid]="${base0A}" + theme[upload_end]="${base08}" + theme[process_start]="${base0B}" + theme[process_mid]="${base0A}" + theme[process_end]="${base08}" + ''; }; } diff --git a/modules/console/nixos.nix b/modules/console/nixos.nix index 5f7b103a..2b49f165 100644 --- a/modules/console/nixos.nix +++ b/modules/console/nixos.nix @@ -1,29 +1,26 @@ { config, lib, ... }: - -with config.lib.stylix.colors; - { options.stylix.targets.console.enable = config.lib.stylix.mkEnableTarget "the Linux kernel console" true; config.console.colors = - lib.mkIf (config.stylix.enable && config.stylix.targets.console.enable) - [ - base00-hex - red - green - yellow - blue - magenta - cyan - base05-hex - base03-hex - red - green - yellow - blue - magenta - cyan - base06-hex - ]; + with config.lib.stylix.colors; + lib.mkIf (config.stylix.enable && config.stylix.targets.console.enable) [ + base00-hex + red + green + yellow + blue + magenta + cyan + base05-hex + base03-hex + red + green + yellow + blue + magenta + cyan + base06-hex + ]; } diff --git a/modules/discord/hm.nix b/modules/discord/hm.nix index b9133ab1..48c5f9bd 100644 --- a/modules/discord/hm.nix +++ b/modules/discord/hm.nix @@ -6,12 +6,10 @@ ... }: let - template = - let - inherit (config.lib.stylix) colors; - inherit (config.stylix) fonts; - in - import ./template.nix { inherit colors fonts; }; + template = import ./template.nix { + inherit (config.lib.stylix) colors; + inherit (config.stylix) fonts; + }; in { options.stylix.targets = diff --git a/modules/dunst/hm.nix b/modules/dunst/hm.nix index f22f8b62..c13dcf53 100644 --- a/modules/dunst/hm.nix +++ b/modules/dunst/hm.nix @@ -1,7 +1,4 @@ { config, lib, ... }: - -with config.lib.stylix.colors.withHashtag; -with config.stylix.fonts; let dunstOpacity = lib.toHexString ( ((builtins.floor (config.stylix.opacity.popups * 100 + 0.5)) * 255) / 100 @@ -12,10 +9,10 @@ in config.lib.stylix.mkEnableTarget "Dunst" true; config = lib.mkIf (config.stylix.enable && config.stylix.targets.dunst.enable) { - services.dunst.settings = { + services.dunst.settings = with config.lib.stylix.colors.withHashtag; { global = { separator_color = base02; - font = "${sansSerif.name} ${toString sizes.popups}"; + font = with config.stylix.fonts; "${sansSerif.name} ${toString sizes.popups}"; }; urgency_low = { diff --git a/modules/emacs/hm.nix b/modules/emacs/hm.nix index c090f7a2..e3d61edf 100644 --- a/modules/emacs/hm.nix +++ b/modules/emacs/hm.nix @@ -4,15 +4,12 @@ lib, ... }: - -with config.lib.stylix.colors.withHashtag; -with config.stylix.fonts; - let + inherit (config.stylix) fonts; emacsOpacity = builtins.toString ( builtins.ceil (config.stylix.opacity.applications * 100) ); - emacsSize = builtins.toString (sizes.terminal * 1.0); + emacsSize = builtins.toString (fonts.sizes.terminal * 1.0); in { options.stylix.targets.emacs.enable = @@ -21,49 +18,52 @@ in config = lib.mkIf (config.stylix.enable && config.stylix.targets.emacs.enable) { programs.emacs = { extraPackages = epkgs: [ - (epkgs.trivialBuild { - pname = "base16-stylix-theme"; - version = "0.1.0"; - src = pkgs.writeText "base16-stylix-theme.el" '' - (require 'base16-theme) + (epkgs.trivialBuild ( + with config.lib.stylix.colors.withHashtag; + { + pname = "base16-stylix-theme"; + version = "0.1.0"; + src = pkgs.writeText "base16-stylix-theme.el" '' + (require 'base16-theme) - (defvar base16-stylix-theme-colors - '(:base00 "${base00}" - :base01 "${base01}" - :base02 "${base02}" - :base03 "${base03}" - :base04 "${base04}" - :base05 "${base05}" - :base06 "${base06}" - :base07 "${base07}" - :base08 "${base08}" - :base09 "${base09}" - :base0A "${base0A}" - :base0B "${base0B}" - :base0C "${base0C}" - :base0D "${base0D}" - :base0E "${base0E}" - :base0F "${base0F}") - "All colors for Base16 stylix are defined here.") + (defvar base16-stylix-theme-colors + '(:base00 "${base00}" + :base01 "${base01}" + :base02 "${base02}" + :base03 "${base03}" + :base04 "${base04}" + :base05 "${base05}" + :base06 "${base06}" + :base07 "${base07}" + :base08 "${base08}" + :base09 "${base09}" + :base0A "${base0A}" + :base0B "${base0B}" + :base0C "${base0C}" + :base0D "${base0D}" + :base0E "${base0E}" + :base0F "${base0F}") + "All colors for Base16 stylix are defined here.") - ;; Define the theme - (deftheme base16-stylix) + ;; Define the theme + (deftheme base16-stylix) - ;; Add all the faces to the theme - (base16-theme-define 'base16-stylix base16-stylix-theme-colors) + ;; Add all the faces to the theme + (base16-theme-define 'base16-stylix base16-stylix-theme-colors) - ;; Mark the theme as provided - (provide-theme 'base16-stylix) + ;; Mark the theme as provided + (provide-theme 'base16-stylix) - ;; Add path to theme to theme-path - (add-to-list 'custom-theme-load-path - (file-name-directory - (file-truename load-file-name))) + ;; Add path to theme to theme-path + (add-to-list 'custom-theme-load-path + (file-name-directory + (file-truename load-file-name))) - (provide 'base16-stylix-theme) - ''; - packageRequires = [ epkgs.base16-theme ]; - }) + (provide 'base16-stylix-theme) + ''; + packageRequires = [ epkgs.base16-theme ]; + } + )) ]; extraConfig = '' @@ -72,7 +72,7 @@ in (setq base16-theme-256-color-source 'colors) (load-theme 'base16-stylix t) ;; Set font - (set-face-attribute 'default nil :font (font-spec :family "${monospace.name}" :size ${emacsSize})) + (set-face-attribute 'default nil :font (font-spec :family "${fonts.monospace.name}" :size ${emacsSize})) ;; ----------------------------- ;; set opacity (add-to-list 'default-frame-alist '(alpha-background . ${emacsOpacity})) diff --git a/modules/foot/hm.nix b/modules/foot/hm.nix index b242bd10..66d0e47b 100644 --- a/modules/foot/hm.nix +++ b/modules/foot/hm.nix @@ -1,18 +1,14 @@ { config, lib, ... }: - let - cfg = config.stylix.targets.foot; - theme = config.lib.stylix.colors { templateRepo = config.stylix.inputs.tinted-foot; }; - in { options.stylix.targets.foot.enable = config.lib.stylix.mkEnableTarget "Foot" true; - config.programs.foot.settings = lib.mkIf cfg.enable { + config.programs.foot.settings = lib.mkIf config.stylix.targets.foot.enable { main = { include = theme; font = @@ -20,6 +16,6 @@ in "${monospace.name}:size=${toString sizes.terminal}"; dpi-aware = "no"; }; - colors.alpha = with config.stylix.opacity; terminal; + colors.alpha = config.stylix.opacity.terminal; }; } diff --git a/modules/fuzzel/hm.nix b/modules/fuzzel/hm.nix index af11b503..b141c761 100644 --- a/modules/fuzzel/hm.nix +++ b/modules/fuzzel/hm.nix @@ -1,10 +1,6 @@ { config, lib, ... }: - -with config.lib.stylix.colors; - let opacity = lib.toHexString (builtins.ceil (config.stylix.opacity.popups * 255)); - in { options.stylix.targets.fuzzel.enable = @@ -13,7 +9,7 @@ in config.programs.fuzzel.settings = lib.mkIf (config.stylix.enable && config.stylix.targets.fuzzel.enable) { - colors = { + colors = with config.lib.stylix.colors; { background = "${base00-hex}${opacity}"; text = "${base05-hex}ff"; placeholder = "${base03-hex}ff"; diff --git a/modules/grub/nixos.nix b/modules/grub/nixos.nix index e767516f..463c07e7 100644 --- a/modules/grub/nixos.nix +++ b/modules/grub/nixos.nix @@ -5,12 +5,9 @@ ... }: -with config.lib.stylix; -with config.stylix.fonts; -with config.lib.stylix.colors.withHashtag; - let cfg = config.stylix.targets.grub; + inherit (config.stylix) imageScalingMode fonts; # Grub requires fonts to be converted to "PFF2 format" # This function takes a font { name, package } and produces a .pf2 file mkGrubFont = @@ -28,11 +25,9 @@ let ) # Convert to .pf2 - ${pkgs.grub2}/bin/grub-mkfont $font --output $out --size ${toString sizes.applications} + ${pkgs.grub2}/bin/grub-mkfont $font --output $out --size ${toString fonts.sizes.applications} ''; - inherit (config.stylix) imageScalingMode; - image-scale = if imageScalingMode == "fill" then "crop" @@ -62,90 +57,94 @@ in ]; }) ]; - options.stylix.targets.grub = { - enable = config.lib.stylix.mkEnableTarget "GRUB" true; - useWallpaper = config.lib.stylix.mkEnableWallpaper "GRUB" false; + options.stylix.targets.grub = with config.lib.stylix; { + enable = mkEnableTarget "GRUB" true; + useWallpaper = mkEnableWallpaper "GRUB" false; }; - config.boot.loader.grub = lib.mkIf (config.stylix.enable && cfg.enable) { - backgroundColor = base00; - # Need to override the NixOS splash, this will match the background - splashImage = pixel "base00"; + config.boot.loader.grub = + with config.lib.stylix.colors.withHashtag; + with config.lib.stylix; + with config.stylix.fonts; + lib.mkIf (config.stylix.enable && cfg.enable) { + backgroundColor = base00; + # Need to override the NixOS splash, this will match the background + splashImage = pixel "base00"; - # This font will be used for the GRUB terminal - font = toString (mkGrubFont monospace); + # This font will be used for the GRUB terminal + font = toString (mkGrubFont fonts.monospace); - # TODO: Include OS icons - theme = - pkgs.runCommand "stylix-grub" - { - themeTxt = '' - desktop-image: "background.png" - desktop-image-scale-method: "${image-scale}" - desktop-color: "${base00}" + # TODO: Include OS icons + theme = + pkgs.runCommand "stylix-grub" + { + themeTxt = '' + desktop-image: "background.png" + desktop-image-scale-method: "${image-scale}" + desktop-color: "${base00}" - title-text: "" + title-text: "" - terminal-left: "10%" - terminal-top: "20%" - terminal-width: "80%" - terminal-height: "60%" + terminal-left: "10%" + terminal-top: "20%" + terminal-width: "80%" + terminal-height: "60%" - + progress_bar { - left = 25% - top = 80%+20 # 20 pixels below boot menu - width = 50% - height = 30 + + progress_bar { + left = 25% + top = 80%+20 # 20 pixels below boot menu + width = 50% + height = 30 - id = "__timeout__" - show_text = true - font = "${sansSerif.name}" - text = "@TIMEOUT_NOTIFICATION_MIDDLE@" + id = "__timeout__" + show_text = true + font = "${fonts.sansSerif.name}" + text = "@TIMEOUT_NOTIFICATION_MIDDLE@" - border_color = "${base00}" - bg_color = "${base00}" - fg_color = "${base0B}" - text_color = "${base05}" - } + border_color = "${base00}" + bg_color = "${base00}" + fg_color = "${base0B}" + text_color = "${base05}" + } - + boot_menu { - left = 25% - top = 20% - width = 50% - height = 60% - menu_pixmap_style = "background_*.png" + + boot_menu { + left = 25% + top = 20% + width = 50% + height = 60% + menu_pixmap_style = "background_*.png" - item_height = 40 - item_icon_space = 8 - item_spacing = 0 - item_padding = 0 - item_font = "${sansSerif.name}" - item_color = "${base05}" + item_height = 40 + item_icon_space = 8 + item_spacing = 0 + item_padding = 0 + item_font = "${fonts.sansSerif.name}" + item_color = "${base05}" - selected_item_color = "${base01}" - selected_item_pixmap_style = "selection_*.png" - } - ''; - passAsFile = [ "themeTxt" ]; - } - '' - mkdir $out - cp $themeTxtPath $out/theme.txt - - ${ - if - cfg.useWallpaper - # Make sure the background image is .png by asking to convert it - then - "${pkgs.imagemagick}/bin/convert ${config.stylix.image} png32:$out/background.png" - else - "cp ${pixel "base00"} $out/background.png" + selected_item_color = "${base01}" + selected_item_pixmap_style = "selection_*.png" + } + ''; + passAsFile = [ "themeTxt" ]; } + '' + mkdir $out + cp $themeTxtPath $out/theme.txt - cp ${pixel "base01"} $out/background_c.png - cp ${pixel "base0B"} $out/selection_c.png + ${ + if + cfg.useWallpaper + # Make sure the background image is .png by asking to convert it + then + "${pkgs.imagemagick}/bin/convert ${config.stylix.image} png32:$out/background.png" + else + "cp ${pixel "base00"} $out/background.png" + } - cp ${mkGrubFont sansSerif} $out/sans_serif.pf2 - ''; - }; + cp ${pixel "base01"} $out/background_c.png + cp ${pixel "base0B"} $out/selection_c.png + + cp ${mkGrubFont sansSerif} $out/sans_serif.pf2 + ''; + }; } diff --git a/modules/hyprlock/hm.nix b/modules/hyprlock/hm.nix index e1a23e6c..083ce28e 100644 --- a/modules/hyprlock/hm.nix +++ b/modules/hyprlock/hm.nix @@ -1,23 +1,20 @@ { config, lib, ... }: - -with config.lib.stylix; - let cfg = config.stylix.targets.hyprlock; in { - options.stylix.targets.hyprlock = { + options.stylix.targets.hyprlock = with config.lib.stylix; { enable = mkEnableTarget "Hyprlock" true; useWallpaper = mkEnableWallpaper "Hyprlock" true; }; config = lib.mkIf (config.stylix.enable && cfg.enable) { - programs.hyprlock.settings = { + programs.hyprlock.settings = with config.lib.stylix.colors; { background = { - color = "rgb(${colors.base00})"; + color = "rgb(${base00})"; path = lib.mkIf cfg.useWallpaper "${config.stylix.image}"; }; - input-field = with colors; { + input-field = { outer_color = "rgb(${base03})"; inner_color = "rgb(${base00})"; font_color = "rgb(${base05})"; diff --git a/modules/i3/hm.nix b/modules/i3/hm.nix index 794c8cd0..70643d38 100644 --- a/modules/i3/hm.nix +++ b/modules/i3/hm.nix @@ -1,13 +1,5 @@ { config, lib, ... }: - -with config.lib.stylix.colors.withHashtag; - let - text = base05; - urgent = base08; - focused = base0D; - unfocused = base03; - fonts = let inherit (config.stylix) fonts; @@ -16,89 +8,96 @@ let names = [ fonts.sansSerif.name ]; size = fonts.sizes.desktop * 1.0; }; - in { options.stylix.targets.i3.enable = config.lib.stylix.mkEnableTarget "i3" true; - config = lib.mkMerge [ - (lib.mkIf config.stylix.targets.i3.enable { - xsession.windowManager.i3.config = { - inherit fonts; + config = + with config.lib.stylix.colors.withHashtag; + let + text = base05; + urgent = base08; + focused = base0D; + unfocused = base03; + in + lib.mkMerge [ + (lib.mkIf config.stylix.targets.i3.enable { + xsession.windowManager.i3.config = { + inherit fonts; - colors = - let - background = base00; - indicator = base0B; - in - { - inherit background; - urgent = { - inherit background indicator text; - border = urgent; - childBorder = urgent; + colors = + let + background = base00; + indicator = base0B; + in + { + inherit background; + urgent = { + inherit background indicator text; + border = urgent; + childBorder = urgent; + }; + focused = { + inherit background indicator text; + border = focused; + childBorder = focused; + }; + focusedInactive = { + inherit background indicator text; + border = unfocused; + childBorder = unfocused; + }; + unfocused = { + inherit background indicator text; + border = unfocused; + childBorder = unfocused; + }; + placeholder = { + inherit background indicator text; + border = unfocused; + childBorder = unfocused; + }; }; - focused = { - inherit background indicator text; - border = focused; - childBorder = focused; - }; - focusedInactive = { - inherit background indicator text; - border = unfocused; - childBorder = unfocused; - }; - unfocused = { - inherit background indicator text; - border = unfocused; - childBorder = unfocused; - }; - placeholder = { - inherit background indicator text; - border = unfocused; - childBorder = unfocused; - }; - }; - # output."*".bg = "${config.stylix.image} fill"; - }; - }) + # output."*".bg = "${config.stylix.image} fill"; + }; + }) - { - # Merge this with your bar configuration using //config.lib.stylix.i3.bar - lib.stylix.i3.bar = { - inherit fonts; + { + # Merge this with your bar configuration using //config.lib.stylix.i3.bar + lib.stylix.i3.bar = { + inherit fonts; - colors = - let - background = base00; - border = background; - in - { - inherit background; - statusline = text; - separator = base03; - focusedWorkspace = { - inherit text background; - border = focused; + colors = + let + background = base00; + border = background; + in + { + inherit background; + statusline = text; + separator = base03; + focusedWorkspace = { + inherit text background; + border = focused; + }; + activeWorkspace = { + inherit border background; + text = focused; + }; + inactiveWorkspace = { + inherit text border background; + }; + urgentWorkspace = { + inherit text background; + border = urgent; + }; + bindingMode = { + inherit text border; + background = urgent; + }; }; - activeWorkspace = { - inherit border background; - text = focused; - }; - inactiveWorkspace = { - inherit text border background; - }; - urgentWorkspace = { - inherit text background; - border = urgent; - }; - bindingMode = { - inherit text border; - background = urgent; - }; - }; - }; - } - ]; + }; + } + ]; } diff --git a/modules/i3status-rust/hm.nix b/modules/i3status-rust/hm.nix index 47fbd727..ebac3328 100644 --- a/modules/i3status-rust/hm.nix +++ b/modules/i3status-rust/hm.nix @@ -1,22 +1,19 @@ -{ config, lib, ... }: - -let - colors = config.lib.stylix.colors.withHashtag; -in +{ config, ... }: { # Merge this with your bar's theme's overrides with //config.lib.stylix.i3status-rust.bar - config.lib.stylix.i3status-rust.bar = with colors; { - idle_bg = base00; - idle_fg = base05; - info_bg = base09; - info_fg = base00; - good_bg = base01; - good_fg = base05; - warning_bg = base0A; - warning_fg = base00; - critical_bg = base08; - critical_fg = base00; - separator_bg = base00; - separator_fg = base05; - }; + config.lib.stylix.i3status-rust.bar = + with config.lib.stylix.colors.withHashtag; { + idle_bg = base00; + idle_fg = base05; + info_bg = base09; + info_fg = base00; + good_bg = base01; + good_fg = base05; + warning_bg = base0A; + warning_fg = base00; + critical_bg = base08; + critical_fg = base00; + separator_bg = base00; + separator_fg = base05; + }; } diff --git a/modules/k9s/hm.nix b/modules/k9s/hm.nix index 0706ce33..127e9f3f 100644 --- a/modules/k9s/hm.nix +++ b/modules/k9s/hm.nix @@ -1,12 +1,9 @@ { config, lib, ... }: - -with config.lib.stylix.colors.withHashtag; - { options.stylix.targets.k9s.enable = config.lib.stylix.mkEnableTarget "k9s" true; config = lib.mkIf config.stylix.targets.k9s.enable { - programs.k9s.skins.skin = { + programs.k9s.skins.skin = with config.lib.stylix.colors.withHashtag; { k9s = { body = { fgColor = base05-hex; diff --git a/modules/kubecolor/hm.nix b/modules/kubecolor/hm.nix index 942eee0a..8a306130 100644 --- a/modules/kubecolor/hm.nix +++ b/modules/kubecolor/hm.nix @@ -7,66 +7,66 @@ programs.kubecolor.settings = { preset = if config.stylix.polarity == "either" then "" else "${config.stylix.polarity}"; - theme = { + theme = with config.lib.stylix.colors.withHashtag; { base = { - info = "fg=${config.lib.stylix.colors.withHashtag.base05-hex}"; - primary = "fg=${config.lib.stylix.colors.withHashtag.base0E-hex}"; - secondary = "fg=${config.lib.stylix.colors.withHashtag.base0D-hex}"; - success = "fg=${config.lib.stylix.colors.withHashtag.base0B-hex}:bold"; - warning = "fg=${config.lib.stylix.colors.withHashtag.base0A-hex}:bold"; - danger = "fg=${config.lib.stylix.colors.withHashtag.base08-hex}:bold"; - muted = "fg=${config.lib.stylix.colors.withHashtag.base04-hex}"; - key = "fg=${config.lib.stylix.colors.withHashtag.base07-hex}:bold"; + info = "fg=${base05-hex}"; + primary = "fg=${base0E-hex}"; + secondary = "fg=${base0D-hex}"; + success = "fg=${base0B-hex}:bold"; + warning = "fg=${base0A-hex}:bold"; + danger = "fg=${base08-hex}:bold"; + muted = "fg=${base04-hex}"; + key = "fg=${base07-hex}:bold"; }; - default = "fg=${config.lib.stylix.colors.withHashtag.base05-hex}"; + default = "fg=${base05-hex}"; data = { - key = "fg=${config.lib.stylix.colors.withHashtag.base07-hex}:bold"; - string = "fg=${config.lib.stylix.colors.withHashtag.base05-hex}"; - true = "fg=${config.lib.stylix.colors.withHashtag.base0B-hex}:bold"; - false = "fg=${config.lib.stylix.colors.withHashtag.base08-hex}:bold"; - number = "fg=${config.lib.stylix.colors.withHashtag.base0E-hex}"; - null = "fg=${config.lib.stylix.colors.withHashtag.base04-hex}"; - quantity = "fg=${config.lib.stylix.colors.withHashtag.base0E-hex}"; - duration = "fg=${config.lib.stylix.colors.withHashtag.base09-hex}"; - durationfresh = "fg=${config.lib.stylix.colors.withHashtag.base0B-hex}"; + key = "fg=${base07-hex}:bold"; + string = "fg=${base05-hex}"; + true = "fg=${base0B-hex}:bold"; + false = "fg=${base08-hex}:bold"; + number = "fg=${base0E-hex}"; + null = "fg=${base04-hex}"; + quantity = "fg=${base0E-hex}"; + duration = "fg=${base09-hex}"; + durationfresh = "fg=${base0B-hex}"; ratio = { - zero = "fg=${config.lib.stylix.colors.withHashtag.base04-hex}"; - equal = "fg=${config.lib.stylix.colors.withHashtag.base0B-hex}"; - unequal = "fg=${config.lib.stylix.colors.withHashtag.base0A-hex}"; + zero = "fg=${base04-hex}"; + equal = "fg=${base0B-hex}"; + unequal = "fg=${base0A-hex}"; }; }; status = { - success = "fg=${config.lib.stylix.colors.withHashtag.base0B-hex}:bold"; - warning = "fg=${config.lib.stylix.colors.withHashtag.base0A-hex}:bold"; - error = "fg=${config.lib.stylix.colors.withHashtag.base08-hex}:bold"; + success = "fg=${base0B-hex}:bold"; + warning = "fg=${base0A-hex}:bold"; + error = "fg=${base08-hex}:bold"; }; table = { - header = "fg=${config.lib.stylix.colors.withHashtag.base05-hex}:bold"; - columns = "fg=${config.lib.stylix.colors.withHashtag.base05-hex}"; + header = "fg=${base05-hex}:bold"; + columns = "fg=${base05-hex}"; }; stderr = { - default = "fg=${config.lib.stylix.colors.withHashtag.base05-hex}"; - error = "fg=${config.lib.stylix.colors.withHashtag.base08-hex}:bold"; + default = "fg=${base05-hex}"; + error = "fg=${base08-hex}:bold"; }; describe = { - key = "fg=${config.lib.stylix.colors.withHashtag.base07-hex}:bold"; + key = "fg=${base07-hex}:bold"; }; apply = { - created = "fg=${config.lib.stylix.colors.withHashtag.base0B-hex}"; - configured = "fg=${config.lib.stylix.colors.withHashtag.base0A-hex}"; - unchanged = "fg=${config.lib.stylix.colors.withHashtag.base05-hex}"; - dryrun = "fg=${config.lib.stylix.colors.withHashtag.base0D-hex}"; - fallback = "fg=${config.lib.stylix.colors.withHashtag.base05-hex}"; + created = "fg=${base0B-hex}"; + configured = "fg=${base0A-hex}"; + unchanged = "fg=${base05-hex}"; + dryrun = "fg=${base0D-hex}"; + fallback = "fg=${base05-hex}"; }; explain = { - key = "fg=${config.lib.stylix.colors.withHashtag.base07-hex}:bold"; - required = "fg=${config.lib.stylix.colors.withHashtag.base00-hex}:bold"; + key = "fg=${base07-hex}:bold"; + required = "fg=${base00-hex}:bold"; }; options = { - flag = "fg=${config.lib.stylix.colors.withHashtag.base07-hex}:bold"; + flag = "fg=${base07-hex}:bold"; }; version = { - key = "fg=${config.lib.stylix.colors.withHashtag.base07-hex}:bold"; + key = "fg=${base07-hex}:bold"; }; }; }; diff --git a/modules/mako/hm.nix b/modules/mako/hm.nix index 2acbe1f3..54ca5e29 100644 --- a/modules/mako/hm.nix +++ b/modules/mako/hm.nix @@ -4,9 +4,6 @@ options, ... }: - -with config.lib.stylix.colors.withHashtag; -with config.stylix.fonts; let makoOpacity = lib.toHexString ( ((builtins.ceil (config.stylix.opacity.popups * 100)) * 255) / 100 @@ -19,25 +16,28 @@ in # Referenced https://github.com/stacyharper/base16-mako config = lib.optionalAttrs (options.services ? mako) ( lib.mkIf (config.stylix.enable && config.stylix.targets.mako.enable) { - services.mako = { - backgroundColor = base00 + makoOpacity; - borderColor = base0D; - textColor = base05; - progressColor = "over ${base02}"; - font = "${sansSerif.name} ${toString sizes.popups}"; - # I wish the mako hm module was like the dunst one - extraConfig = '' - [urgency=low] - background-color=${base00}${makoOpacity} - border-color=${base0D} - text-color=${base0A} + services.mako = + with config.lib.stylix.colors.withHashtag; + with config.stylix.fonts; + { + backgroundColor = base00 + makoOpacity; + borderColor = base0D; + textColor = base05; + progressColor = "over ${base02}"; + font = "${sansSerif.name} ${toString sizes.popups}"; + # I wish the mako hm module was like the dunst one + extraConfig = '' + [urgency=low] + background-color=${base00}${makoOpacity} + border-color=${base0D} + text-color=${base0A} - [urgency=high] - background-color=${base00}${makoOpacity} - border-color=${base0D} - text-color=${base08} - ''; - }; + [urgency=high] + background-color=${base00}${makoOpacity} + border-color=${base0D} + text-color=${base08} + ''; + }; } ); } diff --git a/modules/mangohud/hm.nix b/modules/mangohud/hm.nix index 53ee2880..ef78662e 100644 --- a/modules/mangohud/hm.nix +++ b/modules/mangohud/hm.nix @@ -1,8 +1,6 @@ { config, lib, ... }: - let inherit (config.stylix) fonts opacity; - inherit (config.lib.stylix) colors; in { options.stylix.targets.mangohud.enable = @@ -11,7 +9,7 @@ in config = lib.mkIf (config.stylix.enable && config.stylix.targets.mangohud.enable) { - programs.mangohud.settings = with colors; { + programs.mangohud.settings = with config.lib.stylix.colors; { font_size = fonts.sizes.applications; font_size_text = fonts.sizes.applications; background_alpha = opacity.popups; diff --git a/modules/ncspot/hm.nix b/modules/ncspot/hm.nix index 0a8cd319..66387bc4 100644 --- a/modules/ncspot/hm.nix +++ b/modules/ncspot/hm.nix @@ -7,32 +7,28 @@ config = lib.mkIf (config.stylix.enable && config.stylix.targets.ncspot.enable) { - programs.ncspot.settings = - let - colors = config.lib.stylix.colors.withHashtag; - in - { - theme = with colors; { - background = - if (config.stylix.opacity.terminal != 1.0) then "#00000000" else base00; - primary = base05; - secondary = base04; - title = base06; - playing = base0B; - playing_selected = base0B; - playing_bg = - if (config.stylix.opacity.terminal != 1.0) then "#00000000" else base00; - highlight = base05; - highlight_bg = base02; - error = base05; - error_bg = base08; - statusbar = base00; - statusbar_progress = base04; - statusbar_bg = base04; - cmdline = base02; - cmdline_bg = base05; - search_match = base05; - }; + programs.ncspot.settings = { + theme = with config.lib.stylix.colors.withHashtag; { + background = + if (config.stylix.opacity.terminal != 1.0) then "#00000000" else base00; + primary = base05; + secondary = base04; + title = base06; + playing = base0B; + playing_selected = base0B; + playing_bg = + if (config.stylix.opacity.terminal != 1.0) then "#00000000" else base00; + highlight = base05; + highlight_bg = base02; + error = base05; + error_bg = base08; + statusbar = base00; + statusbar_progress = base04; + statusbar_bg = base04; + cmdline = base02; + cmdline_bg = base05; + search_match = base05; }; + }; }; } diff --git a/modules/nixos-icons/nixos.nix b/modules/nixos-icons/nixos.nix index e2fc7214..e45d774c 100644 --- a/modules/nixos-icons/nixos.nix +++ b/modules/nixos-icons/nixos.nix @@ -4,9 +4,6 @@ lib, ... }: - -with config.lib.stylix.colors; - { options.stylix.targets.nixos-icons.enable = config.lib.stylix.mkEnableTarget "the NixOS logo" true; @@ -18,7 +15,7 @@ with config.lib.stylix.colors; nixos-icons = super.nixos-icons.overrideAttrs (oldAttrs: { src = pkgs.applyPatches { inherit (oldAttrs) src; - prePatch = '' + prePatch = with config.lib.stylix.colors; '' substituteInPlace logo/nix-snowflake-white.svg --replace-fail '#ffffff' '#${base05}' # Insert attribution comment after the XML prolog diff --git a/modules/nushell/hm.nix b/modules/nushell/hm.nix index a355b33f..d1345cb7 100644 --- a/modules/nushell/hm.nix +++ b/modules/nushell/hm.nix @@ -1,50 +1,47 @@ { config, lib, ... }: - -with config.lib.stylix.colors.withHashtag; - { options.stylix.targets.nushell.enable = config.lib.stylix.mkEnableTarget "Nushell" true; # Adapted from https://www.nushell.sh/book/coloring_and_theming.html#theming config.programs.nushell.extraConfig = - lib.mkIf (config.stylix.enable && config.stylix.targets.nushell.enable) - '' - $env.config.color_config = { - separator: "${base03}" - leading_trailing_space_bg: "${base04}" - header: "${base0B}" - date: "${base0E}" - filesize: "${base0D}" - row_index: "${base0C}" - bool: "${base08}" - int: "${base0B}" - duration: "${base08}" - range: "${base08}" - float: "${base08}" - string: "${base04}" - nothing: "${base08}" - binary: "${base08}" - cellpath: "${base08}" - hints: dark_gray + with config.lib.stylix.colors.withHashtag; + lib.mkIf (config.stylix.enable && config.stylix.targets.nushell.enable) '' + $env.config.color_config = { + separator: "${base03}" + leading_trailing_space_bg: "${base04}" + header: "${base0B}" + date: "${base0E}" + filesize: "${base0D}" + row_index: "${base0C}" + bool: "${base08}" + int: "${base0B}" + duration: "${base08}" + range: "${base08}" + float: "${base08}" + string: "${base04}" + nothing: "${base08}" + binary: "${base08}" + cellpath: "${base08}" + hints: dark_gray - shape_garbage: { fg: "${base07}" bg: "${base08}" } - shape_bool: "${base0D}" - shape_int: { fg: "${base0E}" attr: b } - shape_float: { fg: "${base0E}" attr: b } - shape_range: { fg: "${base0A}" attr: b } - shape_internalcall: { fg: "${base0C}" attr: b } - shape_external: "${base0C}" - shape_externalarg: { fg: "${base0B}" attr: b } - shape_literal: "${base0D}" - shape_operator: "${base0A}" - shape_signature: { fg: "${base0B}" attr: b } - shape_string: "${base0B}" - shape_filepath: "${base0D}" - shape_globpattern: { fg: "${base0D}" attr: b } - shape_variable: "${base0E}" - shape_flag: { fg: "${base0D}" attr: b } - shape_custom: { attr: b } - } - ''; + shape_garbage: { fg: "${base07}" bg: "${base08}" } + shape_bool: "${base0D}" + shape_int: { fg: "${base0E}" attr: b } + shape_float: { fg: "${base0E}" attr: b } + shape_range: { fg: "${base0A}" attr: b } + shape_internalcall: { fg: "${base0C}" attr: b } + shape_external: "${base0C}" + shape_externalarg: { fg: "${base0B}" attr: b } + shape_literal: "${base0D}" + shape_operator: "${base0A}" + shape_signature: { fg: "${base0B}" attr: b } + shape_string: "${base0B}" + shape_filepath: "${base0D}" + shape_globpattern: { fg: "${base0D}" attr: b } + shape_variable: "${base0E}" + shape_flag: { fg: "${base0D}" attr: b } + shape_custom: { attr: b } + } + ''; } diff --git a/modules/qutebrowser/hm.nix b/modules/qutebrowser/hm.nix index 618342d8..2b89cbe5 100644 --- a/modules/qutebrowser/hm.nix +++ b/modules/qutebrowser/hm.nix @@ -1,239 +1,223 @@ { config, lib, ... }: - -with config.lib.stylix.colors.withHashtag; -with config.stylix.fonts; - let - background = base00; - secondary-background = base01; - selection-background = base03; + colors = config.lib.stylix.colors.withHashtag; + background = colors.base00; + secondary-background = colors.base01; + selection-background = colors.base03; - foreground = base05; - inverted-foreground = base00; + foreground = colors.base05; + inverted-foreground = colors.base00; - error = base08; + error = colors.base08; - info = base0B; - secondary-info = base0C; + info = colors.base0B; + secondary-info = colors.base0C; - warning = base0E; + warning = colors.base0E; in { options.stylix.targets.qutebrowser.enable = config.lib.stylix.mkEnableTarget "Qutebrowser" true; config = - lib.mkIf (config.stylix.enable && config.stylix.targets.qutebrowser.enable) - { - programs.qutebrowser.settings = { - colors = { - completion = { - category = { - bg = background; - fg = info; + with config.stylix.fonts; + lib.mkIf (config.stylix.enable && config.stylix.targets.qutebrowser.enable) { + programs.qutebrowser.settings = { + colors = { + completion = { + category = { + bg = background; + fg = info; - border = { - bottom = background; - top = background; - }; + border = { + bottom = background; + top = background; + }; + }; + + even.bg = background; + fg = foreground; + + item.selected = { + bg = selection-background; + + border = { + bottom = selection-background; + top = selection-background; }; - even.bg = background; fg = foreground; - - item.selected = { - bg = selection-background; - - border = { - bottom = selection-background; - top = selection-background; - }; - - fg = foreground; - }; - - match.fg = info; - odd.bg = secondary-background; - - scrollbar = { - bg = background; - fg = foreground; - }; }; - contextmenu = { - disabled = { - bg = secondary-background; - fg = inverted-foreground; - }; + match.fg = info; + odd.bg = secondary-background; - menu = { - bg = background; - fg = foreground; - }; - - selected = { - bg = selection-background; - fg = foreground; - }; + scrollbar = { + bg = background; + fg = foreground; }; + }; - downloads = { - bar.bg = background; - - error = { - bg = error; - fg = inverted-foreground; - }; - - start = { - bg = info; - fg = inverted-foreground; - }; - - stop = { - bg = secondary-info; - fg = inverted-foreground; - }; - }; - - hints = { + contextmenu = { + disabled = { bg = secondary-background; - fg = foreground; - match.fg = info; + fg = inverted-foreground; }; - keyhint = { + menu = { bg = background; fg = foreground; - suffix.fg = foreground; }; - messages = { - error = { - bg = error; - fg = inverted-foreground; - border = error; - }; - - info = { - bg = info; - fg = inverted-foreground; - border = info; - }; - - warning = { - bg = warning; - fg = inverted-foreground; - border = warning; - }; - }; - - prompts = { - bg = background; - border = background; + selected = { + bg = selection-background; fg = foreground; - selected.bg = secondary-background; + }; + }; + + downloads = { + bar.bg = background; + + error = { + bg = error; + fg = inverted-foreground; }; - statusbar = { - caret = { + start = { + bg = info; + fg = inverted-foreground; + }; + + stop = { + bg = secondary-info; + fg = inverted-foreground; + }; + }; + + hints = { + bg = secondary-background; + fg = foreground; + match.fg = info; + }; + + keyhint = { + bg = background; + fg = foreground; + suffix.fg = foreground; + }; + + messages = { + error = { + bg = error; + fg = inverted-foreground; + border = error; + }; + + info = { + bg = info; + fg = inverted-foreground; + border = info; + }; + + warning = { + bg = warning; + fg = inverted-foreground; + border = warning; + }; + }; + + prompts = { + bg = background; + border = background; + fg = foreground; + selected.bg = secondary-background; + }; + + statusbar = { + caret = { + bg = selection-background; + fg = foreground; + + selection = { bg = selection-background; fg = foreground; - - selection = { - bg = selection-background; - fg = foreground; - }; }; + }; - command = { - bg = background; - fg = foreground; - - private = { - bg = secondary-background; - fg = foreground; - }; - }; - - insert = { - bg = info; - fg = inverted-foreground; - }; - - normal = { - bg = background; - fg = foreground; - }; - - passthrough = { - bg = secondary-info; - fg = inverted-foreground; - }; + command = { + bg = background; + fg = foreground; private = { bg = secondary-background; fg = foreground; }; - - progress.bg = info; - - url = { - error.fg = error; - fg = foreground; - hover.fg = foreground; - - success = { - http.fg = secondary-info; - https.fg = info; - }; - - warn.fg = warning; - }; }; - tabs = { - bar.bg = background; + insert = { + bg = info; + fg = inverted-foreground; + }; - even = { - bg = secondary-background; - fg = foreground; + normal = { + bg = background; + fg = foreground; + }; + + passthrough = { + bg = secondary-info; + fg = inverted-foreground; + }; + + private = { + bg = secondary-background; + fg = foreground; + }; + + progress.bg = info; + + url = { + error.fg = error; + fg = foreground; + hover.fg = foreground; + + success = { + http.fg = secondary-info; + https.fg = info; }; - indicator = { - inherit error; - start = secondary-info; - stop = info; + warn.fg = warning; + }; + }; + + tabs = { + bar.bg = background; + + even = { + bg = secondary-background; + fg = foreground; + }; + + indicator = { + inherit error; + start = secondary-info; + stop = info; + }; + + odd = { + bg = background; + fg = foreground; + }; + + pinned = { + even = { + bg = info; + fg = inverted-foreground; }; odd = { - bg = background; - fg = foreground; - }; - - pinned = { - even = { - bg = info; - fg = inverted-foreground; - }; - - odd = { - bg = secondary-info; - fg = inverted-foreground; - }; - - selected = { - even = { - bg = selection-background; - fg = foreground; - }; - - odd = { - bg = selection-background; - fg = foreground; - }; - }; + bg = secondary-info; + fg = inverted-foreground; }; selected = { @@ -249,38 +233,51 @@ in }; }; - webpage = - let - isDark = config.stylix.polarity == "dark"; - in - { - darkmode.enabled = lib.mkIf isDark (lib.mkDefault true); - - preferred_color_scheme = lib.mkIf isDark (lib.mkDefault config.stylix.polarity); - }; - }; - - fonts = { - default_family = sansSerif.name; - default_size = "${toString sizes.applications}pt"; - - web = { - family = { - cursive = serif.name; - fantasy = serif.name; - fixed = monospace.name; - sans_serif = sansSerif.name; - serif = serif.name; - standard = sansSerif.name; + selected = { + even = { + bg = selection-background; + fg = foreground; }; - # TODO: Use the pixel unit: - # https://github.com/danth/stylix/issues/251. - size.default = builtins.floor (sizes.applications * 4 / 3 + 0.5); + odd = { + bg = selection-background; + fg = foreground; + }; }; }; - hints.border = background; + webpage = + let + isDark = config.stylix.polarity == "dark"; + in + { + darkmode.enabled = lib.mkIf isDark (lib.mkDefault true); + + preferred_color_scheme = lib.mkIf isDark (lib.mkDefault config.stylix.polarity); + }; }; + + fonts = { + default_family = sansSerif.name; + default_size = "${toString sizes.applications}pt"; + + web = { + family = { + cursive = serif.name; + fantasy = serif.name; + fixed = monospace.name; + sans_serif = sansSerif.name; + serif = serif.name; + standard = sansSerif.name; + }; + + # TODO: Use the pixel unit: + # https://github.com/danth/stylix/issues/251. + size.default = builtins.floor (sizes.applications * 4 / 3 + 0.5); + }; + }; + + hints.border = background; }; + }; } diff --git a/modules/rio/hm.nix b/modules/rio/hm.nix index 499bb361..a0dfb581 100644 --- a/modules/rio/hm.nix +++ b/modules/rio/hm.nix @@ -5,9 +5,6 @@ lib, ... }: -let - colors = config.lib.stylix.colors.withHashtag; -in { options.stylix.targets.rio.enable = config.lib.stylix.mkEnableTarget "Rio" true; @@ -20,7 +17,7 @@ in size = sizes.terminal * 4.0 / 3.0; }; window.opacity = with config.stylix.opacity; terminal; - colors = with colors; { + colors = with config.lib.stylix.colors.withHashtag; { selection-background = base02; selection-foreground = base05; cursor = base05; diff --git a/modules/rofi/hm.nix b/modules/rofi/hm.nix index c7a2fc20..4175918e 100644 --- a/modules/rofi/hm.nix +++ b/modules/rofi/hm.nix @@ -1,7 +1,4 @@ { config, lib, ... }: - -with config.stylix.fonts; - let inherit (config.lib.formats.rasi) mkLiteral; mkRgba = @@ -24,7 +21,7 @@ in config = lib.mkIf (config.stylix.enable && config.stylix.targets.rofi.enable) { programs.rofi = { - font = "${monospace.name} ${toString sizes.popups}"; + font = with config.stylix.fonts; "${monospace.name} ${toString sizes.popups}"; theme = { "*" = { background = mkRgba rofiOpacity "base00"; diff --git a/modules/sway/hm.nix b/modules/sway/hm.nix index 02230944..0e6fe525 100644 --- a/modules/sway/hm.nix +++ b/modules/sway/hm.nix @@ -1,20 +1,11 @@ { config, lib, ... }: - -with config.lib.stylix.colors.withHashtag; - let cfg = config.stylix.targets.sway; - text = base05; - urgent = base08; - focused = base0D; - unfocused = base03; - fonts = { names = [ config.stylix.fonts.sansSerif.name ]; size = config.stylix.fonts.sizes.desktop + 0.0; }; - in { options.stylix.targets.sway = { @@ -22,89 +13,97 @@ in useWallpaper = config.lib.stylix.mkEnableWallpaper "Sway" true; }; - config = lib.mkMerge [ - (lib.mkIf (config.stylix.enable && cfg.enable) { - wayland.windowManager.sway.config = { - inherit fonts; + config = + with config.lib.stylix.colors.withHashtag; + let + text = base05; + urgent = base08; + focused = base0D; + unfocused = base03; + in + lib.mkMerge [ + (lib.mkIf (config.stylix.enable && cfg.enable) { + wayland.windowManager.sway.config = { + inherit fonts; - colors = - let - background = base00; - indicator = base0B; - in - { - inherit background; - urgent = { - inherit background indicator text; - border = urgent; - childBorder = urgent; + colors = + let + background = base00; + indicator = base0B; + in + { + inherit background; + urgent = { + inherit background indicator text; + border = urgent; + childBorder = urgent; + }; + focused = { + inherit background indicator text; + border = focused; + childBorder = focused; + }; + focusedInactive = { + inherit background indicator text; + border = unfocused; + childBorder = unfocused; + }; + unfocused = { + inherit background indicator text; + border = unfocused; + childBorder = unfocused; + }; + placeholder = { + inherit background indicator text; + border = unfocused; + childBorder = unfocused; + }; }; - focused = { - inherit background indicator text; - border = focused; - childBorder = focused; - }; - focusedInactive = { - inherit background indicator text; - border = unfocused; - childBorder = unfocused; - }; - unfocused = { - inherit background indicator text; - border = unfocused; - childBorder = unfocused; - }; - placeholder = { - inherit background indicator text; - border = unfocused; - childBorder = unfocused; - }; - }; - output."*".bg = - lib.mkIf cfg.useWallpaper "${config.stylix.image} ${config.stylix.imageScalingMode}"; - seat."*".xcursor_theme = lib.mkIf ( - config.stylix.cursor != null - ) ''"${config.stylix.cursor.name}" ${toString config.stylix.cursor.size}''; - }; - }) + output."*".bg = + lib.mkIf cfg.useWallpaper "${config.stylix.image} ${config.stylix.imageScalingMode}"; + seat."*".xcursor_theme = lib.mkIf ( + config.stylix.cursor != null + ) ''"${config.stylix.cursor.name}" ${toString config.stylix.cursor.size}''; + }; + }) - { - # Merge this with your bar configuration using //config.lib.stylix.sway.bar - lib.stylix.sway.bar = { - inherit fonts; + { + # Merge this with your bar configuration using //config.lib.stylix.sway.bar + lib.stylix.sway.bar = { + inherit fonts; - colors = - let - background = base01; - border = background; - in - { - inherit background; - statusline = text; - separator = base03; - focusedWorkspace = { - inherit text border; - background = focused; + colors = + let + background = base01; + border = background; + in + { + inherit background; + statusline = text; + separator = base03; + focusedWorkspace = { + inherit text border; + background = focused; + }; + activeWorkspace = { + inherit text border; + background = unfocused; + }; + inactiveWorkspace = { + inherit text border; + background = unfocused; + }; + urgentWorkspace = { + inherit text border; + background = urgent; + }; + bindingMode = { + inherit text border; + background = urgent; + }; }; - activeWorkspace = { - inherit text border; - background = unfocused; - }; - inactiveWorkspace = { - inherit text border; - background = unfocused; - }; - urgentWorkspace = { - inherit text border; - background = urgent; - }; - bindingMode = { - inherit text border; - background = urgent; - }; - }; - }; - } - ]; + }; + } + ]; } diff --git a/modules/swaylock/hm.nix b/modules/swaylock/hm.nix index d9278e3a..7f83de25 100644 --- a/modules/swaylock/hm.nix +++ b/modules/swaylock/hm.nix @@ -4,19 +4,8 @@ lib, ... }: - -with config.lib.stylix.colors; - let cfg = config.stylix.targets.swaylock; - - inside = base01-hex; - outside = base01-hex; - ring = base05-hex; - text = base05-hex; - positive = base0B-hex; - negative = base08-hex; - in { imports = [ @@ -65,6 +54,15 @@ in ) { programs.swaylock.settings = + with config.lib.stylix.colors; + let + inside = base01-hex; + outside = base01-hex; + ring = base05-hex; + text = base05-hex; + positive = base0B-hex; + negative = base08-hex; + in { color = outside; scaling = config.stylix.imageScalingMode; diff --git a/modules/swaync/hm.nix b/modules/swaync/hm.nix index 4433c920..4a6f828e 100644 --- a/modules/swaync/hm.nix +++ b/modules/swaync/hm.nix @@ -3,10 +3,6 @@ lib, ... }: - -with config.lib.stylix.colors.withHashtag; -with config.stylix.fonts; - { options.stylix.targets.swaync = { enable = config.lib.stylix.mkEnableTarget "SwayNC" true; @@ -16,6 +12,8 @@ with config.stylix.fonts; lib.mkIf (config.stylix.enable && config.stylix.targets.swaync.enable) { services.swaync.style = + with config.stylix.fonts; + with config.lib.stylix.colors.withHashtag; '' @define-color base00 ${base00}; @define-color base01 ${base01}; @define-color base02 ${base02}; @define-color base03 ${base03}; @define-color base04 ${base04}; @define-color base05 ${base05}; @define-color base06 ${base06}; @define-color base07 ${base07}; diff --git a/modules/tofi/hm.nix b/modules/tofi/hm.nix index fe056019..c0b6c1bf 100644 --- a/modules/tofi/hm.nix +++ b/modules/tofi/hm.nix @@ -3,14 +3,14 @@ lib, ... }: -with config.stylix.fonts; -with config.lib.stylix.colors.withHashtag; { options.stylix.targets.tofi.enable = config.lib.stylix.mkEnableTarget "Tofi" true; config = lib.mkIf (config.stylix.enable && config.stylix.targets.tofi.enable) { programs.tofi.settings = + with config.stylix.fonts; + with config.lib.stylix.colors.withHashtag; let opacity = lib.toHexString ( ((builtins.ceil (config.stylix.opacity.popups * 100)) * 255) / 100 diff --git a/modules/vscode/hm.nix b/modules/vscode/hm.nix index c67518f9..c3b41e96 100644 --- a/modules/vscode/hm.nix +++ b/modules/vscode/hm.nix @@ -5,8 +5,6 @@ ... }@args: -with config.stylix.fonts; - let extension = pkgs.runCommandLocal "stylix-vscode" diff --git a/modules/wezterm/hm.nix b/modules/wezterm/hm.nix index c5a45027..5a915e88 100644 --- a/modules/wezterm/hm.nix +++ b/modules/wezterm/hm.nix @@ -1,13 +1,10 @@ { config, lib, ... }: - -let - colors = config.lib.stylix.colors.withHashtag; -in { options.stylix.targets.wezterm.enable = config.lib.stylix.mkEnableTarget "wezterm" true; config = + with config.lib.stylix.colors.withHashtag; lib.mkIf ( config.stylix.enable @@ -15,8 +12,7 @@ in && config.programs.wezterm.enable ) { - - programs.wezterm.colorSchemes.stylix = with colors; { + programs.wezterm.colorSchemes.stylix = { ansi = [ base00 base08 @@ -74,7 +70,6 @@ in }; xdg.configFile."wezterm/wezterm.lua".text = - with colors; with config.stylix.fonts; lib.mkForce '' -- Generated by Stylix diff --git a/modules/wofi/hm.nix b/modules/wofi/hm.nix index 1db9114c..70adae68 100644 --- a/modules/wofi/hm.nix +++ b/modules/wofi/hm.nix @@ -3,45 +3,44 @@ lib, ... }: -with config.stylix.fonts; -let - colors = config.lib.stylix.colors.withHashtag; -in { options.stylix.targets.wofi.enable = config.lib.stylix.mkEnableTarget "wofi" config.programs.wofi.enable; config = lib.mkIf (config.stylix.enable && config.stylix.targets.wofi.enable) { - programs.wofi.style = with colors; '' - window { - font-family: "${monospace.name}"; - font-size: ${toString sizes.popups}pt; + programs.wofi.style = + with config.lib.stylix.colors.withHashtag; + with config.stylix.fonts; + '' + window { + font-family: "${monospace.name}"; + font-size: ${toString sizes.popups}pt; - background-color: ${base00}; - color: ${base05}; - } + background-color: ${base00}; + color: ${base05}; + } - #entry:nth-child(odd) { - background-color: ${base00}; - } + #entry:nth-child(odd) { + background-color: ${base00}; + } - #entry:nth-child(even) { - background-color: ${base01}; - } + #entry:nth-child(even) { + background-color: ${base01}; + } - #entry:selected { - background-color: ${base02}; - } + #entry:selected { + background-color: ${base02}; + } - #input { - background-color: ${base01}; - color: ${base04}; - border-color: ${base02}; - } + #input { + background-color: ${base01}; + color: ${base04}; + border-color: ${base02}; + } - #input:focus { - border-color: ${base0A}; - } - ''; + #input:focus { + border-color: ${base0A}; + } + ''; }; } From cca176fce11ba11dca6ea3ad9d44dca742b9f732 Mon Sep 17 00:00:00 2001 From: Andrew Bell Date: Wed, 19 Mar 2025 12:27:40 +0000 Subject: [PATCH 04/62] stylix: fix cursor undefined error on darwin (#1004) Minor change to fix an error raised on Darwin. The cursor attribute was undefined, I think after #943 was merged. Fixes #1003. --- stylix/home-manager-integration.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stylix/home-manager-integration.nix b/stylix/home-manager-integration.nix index 5834ee3b..6f2019a5 100644 --- a/stylix/home-manager-integration.nix +++ b/stylix/home-manager-integration.nix @@ -2,6 +2,7 @@ lib, config, options, + pkgs, ... }: @@ -37,6 +38,7 @@ let "stylix" "cursor" ]; + condition = _homeConfig: !pkgs.stdenv.hostPlatform.isDarwin; } { path = [ From 0c4ec73df6cbf06e2baa5cb2664540906e4bdc40 Mon Sep 17 00:00:00 2001 From: Daniel Thwaites Date: Wed, 19 Mar 2025 17:10:24 +0000 Subject: [PATCH 05/62] firefox: improve option descriptions for extensions (#998) - Made the descriptions of `colorTheme.enable` and `firefoxGnomeTheme.enable` specify which Firefox derivative they apply to, to clarify that these options are specific to each derivative. - Switched from `mkEnableTarget` to `mkEnableOption`, as these options are not strictly targets: they enable additional programs. This also changes the option description slightly. - Removed the multi-line string as this was adding whitespace where it's not needed, due to the trailing newline. Link: https://github.com/danth/stylix/pull/998 Reviewed-by: NAHO <90870942+trueNAHO@users.noreply.github.com> --- modules/firefox/hm.nix | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/modules/firefox/hm.nix b/modules/firefox/hm.nix index e15c802e..9a35013e 100644 --- a/modules/firefox/hm.nix +++ b/modules/firefox/hm.nix @@ -61,14 +61,9 @@ in default = [ ]; }; - colorTheme.enable = config.lib.stylix.mkEnableTarget '' - [Firefox Color](https://color.firefox.com/) theme - '' false; + colorTheme.enable = lib.mkEnableOption "[Firefox Color](https://color.firefox.com/) on ${target.name}"; - firefoxGnomeTheme.enable = config.lib.stylix.mkEnableTarget '' - [Firefox GNOME - theme](https://github.com/rafaelmardojai/firefox-gnome-theme) - '' false; + firefoxGnomeTheme.enable = lib.mkEnableOption "[Firefox GNOME theme](https://github.com/rafaelmardojai/firefox-gnome-theme) on ${target.name}"; } ) targets ); From 6e9927413fca18e82f1eaf5865ebf6d5ae11d5fb Mon Sep 17 00:00:00 2001 From: awwpotato <153149335+awwpotato@users.noreply.github.com> Date: Wed, 19 Mar 2025 10:33:54 -0700 Subject: [PATCH 06/62] stylix: add editorconfig-checker pre-commit hook (#1006) Add editorconfig-checker pre-commit hook, following commits 7fc0a8716e75 ("stylix: add editorconfig (#945)") and 489833b201a8 ("treewide: give mustache files correct file extensions (#946)"). Link: https://github.com/danth/stylix/pull/1006 Reviewed-by: NAHO <90870942+trueNAHO@users.noreply.github.com> --- flake.nix | 1 + modules/fcitx5/highlight.svg.mustache | 151 +- modules/fcitx5/panel.svg.mustache | 213 +- modules/qt/kvantum.svg.mustache | 3798 ++++++++++++------------- 4 files changed, 2080 insertions(+), 2083 deletions(-) diff --git a/flake.nix b/flake.nix index 26584b30..fd6ee111 100644 --- a/flake.nix +++ b/flake.nix @@ -132,6 +132,7 @@ git-hooks = inputs.git-hooks.lib.${system}.run { hooks = { deadnix.enable = true; + editorconfig-checker.enable = true; hlint.enable = true; nixfmt-rfc-style = { diff --git a/modules/fcitx5/highlight.svg.mustache b/modules/fcitx5/highlight.svg.mustache index 783e1c98..d9fc2f75 100644 --- a/modules/fcitx5/highlight.svg.mustache +++ b/modules/fcitx5/highlight.svg.mustache @@ -1,84 +1,83 @@ - + width="30" + height="30" + version="1.1" + id="svg6" + sodipodi:docname="highlight.svg" + inkscape:version="1.4 (e7c3feb100, 2024-10-09)" + viewBox="0 0 60 60" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg"> + + effect="fillet_chamfer" + id="path-effect998" + is_visible="true" + lpeversion="1" + nodesatellites_param="F,0,0,1,0,15,0,1 @ F,0,0,1,0,15,0,1 @ F,0,0,1,0,15,0,1 @ F,0,0,1,0,15,0,1" + unit="px" + method="arc" + mode="F" + radius="15" + chamfer_steps="1" + flexible="false" + use_knot_distance="true" + apply_no_radius="true" + apply_with_radius="true" + only_selected="false" + hide_knots="false" /> + effect="fillet_chamfer" + id="path-effect996" + is_visible="true" + lpeversion="1" + nodesatellites_param="IC,0,0,1,0,0,0,1 @ IC,0,0,1,0,0,0,1 @ IC,0,0,1,0,0,0,1 @ IC,0,0,1,0,0,0,1 @ IC,0,0,1,0,0,0,1 @ IC,0,0,1,0,0,0,1 @ IC,0,0,1,0,0,0,1 @ IC,0,0,1,0,0,0,1" + unit="px" + method="bezier" + mode="F" + radius="0" + chamfer_steps="1" + flexible="false" + use_knot_distance="true" + apply_no_radius="true" + apply_with_radius="true" + only_selected="false" + hide_knots="false" /> + id="namedview8" + pagecolor="#ffffff" + bordercolor="#000000" + borderopacity="0.25" + inkscape:showpageshadow="2" + inkscape:pageopacity="0.0" + inkscape:pagecheckerboard="0" + inkscape:deskcolor="#d1d1d1" + showgrid="false" + inkscape:zoom="6.0512821" + inkscape:cx="-6.9406779" + inkscape:cy="29.663135" + inkscape:window-width="1440" + inkscape:window-height="834" + inkscape:window-x="0" + inkscape:window-y="0" + inkscape:window-maximized="1" + inkscape:current-layer="svg6" /> + id="svg_1" + width="40" + height="40" + x="10.000001" + y="10.000001" + fill="#015ad7" + stroke="#000000" + stroke-width="0" + rx="0" + sodipodi:type="rect" + d="m 25.000001,10.000001 h 10 a 15,15 45 0 1 15,15 v 10 a 15,15 135 0 1 -15,15 h -10 a 15,15 45 0 1 -15,-15 v -10 a 15,15 135 0 1 15,-15 z" + inkscape:path-effect="#path-effect998" + style="fill:#{{base04-hex}};fill-opacity:1" /> diff --git a/modules/fcitx5/panel.svg.mustache b/modules/fcitx5/panel.svg.mustache index c3e06596..cb245650 100644 --- a/modules/fcitx5/panel.svg.mustache +++ b/modules/fcitx5/panel.svg.mustache @@ -1,124 +1,121 @@ - + width="30" + height="30" + version="1.1" + id="svg7" + sodipodi:docname="panel.svg" + inkscape:version="1.4 (e7c3feb100, 2024-10-09)" + viewBox="0 0 60 60" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg"> + + effect="fillet_chamfer" + id="path-effect1" + is_visible="true" + lpeversion="1" + nodesatellites_param="F,0,0,1,0,19,0,1 @ F,0,0,1,0,19,0,1 @ F,0,0,1,0,19,0,1 @ F,0,0,1,0,19,0,1" + radius="9.5" + unit="px" + method="bezier" + mode="F" + chamfer_steps="1" + flexible="false" + use_knot_distance="true" + apply_no_radius="true" + apply_with_radius="true" + only_selected="false" + hide_knots="false" /> + effect="fillet_chamfer" + id="path-effect475" + is_visible="true" + lpeversion="1" + nodesatellites_param="F,0,0,1,0,0,0,1 @ F,0,0,1,0,0,0,1 @ F,0,0,1,0,0,0,1 @ F,0,0,1,0,0,0,1" + unit="px" + method="auto" + mode="F" + radius="12" + chamfer_steps="1" + flexible="false" + use_knot_distance="true" + apply_no_radius="true" + apply_with_radius="true" + only_selected="false" + hide_knots="false" /> + style="color-interpolation-filters:sRGB" + inkscape:label="Drop Shadow" + id="filter480" + x="-0.2" + y="-0.2" + width="1.4717949" + height="1.4717949"> + flood-opacity="0.498039" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood470" /> + in="flood" + in2="SourceGraphic" + operator="in" + result="composite1" + id="feComposite472" /> + in="composite1" + stdDeviation="3" + result="blur" + id="feGaussianBlur474" /> + dx="2.8" + dy="2.8" + result="offset" + id="feOffset476" /> + in="SourceGraphic" + in2="offset" + operator="over" + result="composite2" + id="feComposite478" /> - - Layer 1 + id="namedview9" + pagecolor="#ffffff" + bordercolor="#000000" + borderopacity="0.25" + inkscape:showpageshadow="2" + inkscape:pageopacity="0.0" + inkscape:pagecheckerboard="0" + inkscape:deskcolor="#d1d1d1" + showgrid="false" + inkscape:zoom="5.9" + inkscape:cx="-36.949153" + inkscape:cy="20.254237" + inkscape:window-width="1440" + inkscape:window-height="834" + inkscape:window-x="0" + inkscape:window-y="0" + inkscape:window-maximized="1" + inkscape:current-layer="g5" /> + + Layer 1 + id="svg_1" + width="39" + height="39" + x="10.5" + y="10.5" + fill="#f0f0f0" + stroke="#adadad" + rx="0" + style="fill:#{{base00-hex}};fill-opacity:1;stroke:#{{base01-hex}};stroke-width:1.2;stroke-dasharray:none;stroke-opacity:1;filter:url(#filter480)" + inkscape:path-effect="#path-effect1" + sodipodi:type="rect" + d="m 29.5,10.5 h 1 c 10.49341,0 19,8.50659 19,19 v 1 c 0,10.49341 -8.50659,19 -19,19 h -1 c -10.49341,0 -19,-8.50659 -19,-19 v -1 c 0,-10.49341 8.50659,-19 19,-19 z" /> diff --git a/modules/qt/kvantum.svg.mustache b/modules/qt/kvantum.svg.mustache index 65196788..f7077c8c 100644 --- a/modules/qt/kvantum.svg.mustache +++ b/modules/qt/kvantum.svg.mustache @@ -1,1954 +1,1954 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - - - - + + + - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + - - - - - - - + + + + + - - - - - - - + + - - - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - + + + + + - - - - - - - - - - + + + + + + + - - - - - - - - - - + + + + + - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + - - + - - - - - + + + + + + + + + + + - + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + + + + + + + + + + - + + + + + + - - - - - - - - - - - - - - + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - + + + + + + - - - - - - - - - - + + + + + + + + + - - - - - - + - + + + + + + + + + + + + + + - + + + + + + + + + + - - + - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From 968f13d47044bdfe07d7a96310e386145900384e Mon Sep 17 00:00:00 2001 From: Chet Luther Date: Wed, 19 Mar 2025 13:37:25 -0400 Subject: [PATCH 07/62] starship: init (#995) Closes: https://github.com/danth/stylix/issues/301 Link: https://github.com/danth/stylix/pull/995 Reviewed-by: awwpotato <153149335+awwpotato@users.noreply.github.com> Reviewed-by: NAHO <90870942+trueNAHO@users.noreply.github.com> --- modules/starship/hm.nix | 79 ++++++++++++++++++++++++++++++++++++ modules/starship/meta.nix | 4 ++ modules/starship/testbed.nix | 26 ++++++++++++ stylix/maintainers.nix | 9 +++- 4 files changed, 117 insertions(+), 1 deletion(-) create mode 100644 modules/starship/hm.nix create mode 100644 modules/starship/meta.nix create mode 100644 modules/starship/testbed.nix diff --git a/modules/starship/hm.nix b/modules/starship/hm.nix new file mode 100644 index 00000000..0e2662f2 --- /dev/null +++ b/modules/starship/hm.nix @@ -0,0 +1,79 @@ +# Starship configuration documentation: https://starship.rs/config/ +{ + config, + lib, + ... +}: +{ + options.stylix.targets.starship.enable = + config.lib.stylix.mkEnableTarget "Starship" true; + + config = + lib.mkIf (config.stylix.enable && config.stylix.targets.starship.enable) + { + programs.starship.settings = { + palette = "base16"; + palettes.base16 = with config.lib.stylix.colors.withHashtag; { + black = base00; + bright-black = base03; + white = base05; + bright-white = base07; + + # There's just one yellow. + bright-yellow = yellow; + + # Starship calls magenta purple. + purple = magenta; + bright-purple = bright-magenta; + + inherit + # Set Starship's standard normal color names. + red + orange + yellow + green + cyan + blue + magenta + brown + + # Set Starship's standard bright color names. + bright-red + bright-orange + bright-green + bright-cyan + bright-blue + bright-magenta + + # Add base16 names to the template for custom usage. + base00 + base01 + base02 + base03 + base04 + base05 + base06 + base07 + base08 + base09 + base0A + base0B + base0C + base0D + base0E + base0F + + # Add base24 names to the template for custom usage. + base10 + base11 + base12 + base13 + base14 + base15 + base16 + base17 + ; + }; + }; + }; +} diff --git a/modules/starship/meta.nix b/modules/starship/meta.nix new file mode 100644 index 00000000..d3b3a7a3 --- /dev/null +++ b/modules/starship/meta.nix @@ -0,0 +1,4 @@ +{ lib, ... }: +{ + maintainers = [ lib.maintainers.cluther ]; +} diff --git a/modules/starship/testbed.nix b/modules/starship/testbed.nix new file mode 100644 index 00000000..3c4870c7 --- /dev/null +++ b/modules/starship/testbed.nix @@ -0,0 +1,26 @@ +{ lib, pkgs, ... }: +{ + stylix.testbed.application = { + enable = true; + name = "Alacritty"; + package = pkgs.alacritty; + }; + + home-manager.sharedModules = lib.singleton { + programs = { + alacritty = { + enable = true; + package = pkgs.alacritty; + }; + bash = { + enable = true; + package = pkgs.bashInteractive; + }; + starship = { + enable = true; + package = pkgs.starship; + enableBashIntegration = true; + }; + }; + }; +} diff --git a/stylix/maintainers.nix b/stylix/maintainers.nix index 2f436b61..12b8b7dc 100644 --- a/stylix/maintainers.nix +++ b/stylix/maintainers.nix @@ -5,4 +5,11 @@ # are expected to follow the same format as described in [1]. # # [1]: https://github.com/NixOS/nixpkgs/blob/1da63e6cc622a0cb6fd5b86d49923e4eb1e33b70/maintainers/maintainer-list.nix -{ } +{ + cluther = { + name = "Chet Luther"; + email = "chet.luther@gmail.com"; + github = "cluther"; + githubId = 86579; + }; +} From ccb411c5db16341455d82d955fef4db9985741a6 Mon Sep 17 00:00:00 2001 From: Mateus Auler Date: Wed, 19 Mar 2025 17:52:09 +0000 Subject: [PATCH 08/62] mpv: set background to black (#1008) Link: https://github.com/danth/stylix/pull/1008 Reviewed-by: awwpotato <153149335+awwpotato@users.noreply.github.com> Reviewed-by: Daniel Thwaites Reviewed-by: NAHO <90870942+trueNAHO@users.noreply.github.com> --- modules/mpv/hm.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/mpv/hm.nix b/modules/mpv/hm.nix index 0606cc33..98a5caea 100644 --- a/modules/mpv/hm.nix +++ b/modules/mpv/hm.nix @@ -10,7 +10,7 @@ osd-font-size = config.stylix.fonts.sizes.applications; sub-font-size = config.stylix.fonts.sizes.applications; - background-color = base00; + background-color = "#000000"; osd-back-color = base01; osd-border-color = base01; osd-color = base05; From 421e09fc7351012f8f8feb1d3db556668cfa77ac Mon Sep 17 00:00:00 2001 From: NAHO <90870942+trueNAHO@users.noreply.github.com> Date: Wed, 19 Mar 2025 20:29:50 +0100 Subject: [PATCH 09/62] doc: format Nix code in Maintainers section according to our formatter (#1024) Fixes: e43eb4e2a7df ("stylix: init module maintainers framework (#977)") --- docs/src/modules.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/src/modules.md b/docs/src/modules.md index af3e0f8d..c49684d2 100644 --- a/docs/src/modules.md +++ b/docs/src/modules.md @@ -135,7 +135,10 @@ number of maintainers: - ```nix { lib, ... }: { - maintainers = with lib.maintainers; [ danth naho ]; + maintainers = with lib.maintainers; [ + danth + naho + ]; } ``` From 603fe2dc7938dd1030da3ed37392b0bfb34222d1 Mon Sep 17 00:00:00 2001 From: Flameopathic <64027365+Flameopathic@users.noreply.github.com> Date: Wed, 19 Mar 2025 17:15:27 -0400 Subject: [PATCH 10/62] treewide: add Flameopathic as maintainer (#1026) --- modules/discord/meta.nix | 3 ++- modules/firefox/meta.nix | 3 ++- modules/vscode/meta.nix | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/discord/meta.nix b/modules/discord/meta.nix index 51e10e61..7cbf701a 100644 --- a/modules/discord/meta.nix +++ b/modules/discord/meta.nix @@ -1,3 +1,4 @@ +{ lib, ... }: { - maintainers = [ ]; + maintainers = [ lib.maintainers.Flameopathic ]; } diff --git a/modules/firefox/meta.nix b/modules/firefox/meta.nix index 51e10e61..7cbf701a 100644 --- a/modules/firefox/meta.nix +++ b/modules/firefox/meta.nix @@ -1,3 +1,4 @@ +{ lib, ... }: { - maintainers = [ ]; + maintainers = [ lib.maintainers.Flameopathic ]; } diff --git a/modules/vscode/meta.nix b/modules/vscode/meta.nix index 51e10e61..7cbf701a 100644 --- a/modules/vscode/meta.nix +++ b/modules/vscode/meta.nix @@ -1,3 +1,4 @@ +{ lib, ... }: { - maintainers = [ ]; + maintainers = [ lib.maintainers.Flameopathic ]; } From 41a773fb0fe47c8652e7c7fd6971c8d0d2ac15ba Mon Sep 17 00:00:00 2001 From: Chet Luther Date: Wed, 19 Mar 2025 18:07:57 -0400 Subject: [PATCH 11/62] k9s: tweak color assignment to style guide (#999) I found that there were some color choices in the k9s module that weren't aligned with the style guide. Most notably this resulted in healthy resources being displayed in red while unhealthy resources were blue. I tried not to make any subjective changes to the original module because overall, it was very well done, and there's no right answer when it comes to things aren't covered by the style guide. In some cases where the style guide doesn't help, I looked at other modules for answers. These are the changes, and the reason for them. 1. prompt.bgColor from base00 to "default" for transparency to shell background. 2. prompt.suggestColor from base0A to base02 because base02 is used as fish_color_autosuggestion in base16-fish via the fish module. 3. dialog.bgColor from "default" to base01 because the style guide says base01 is for alternate background, and that's what this is. 4. dialog.buttonBgColor from base0C to base02 because base0C resulted in white on bright and made button text illegible. Using base02 allows the not-selected button background to still be raised off the base01 background. 5. dialog.buttonFocusFgColor from base0E to base11 because there was another light-on-light issue here that made the focused button text illegible. This change keeps the base0B background color, but uses the darkest possible foreground text to be legible. 6. frame.crumbs.activeColor from base01 to base02 because the style guide says base02 should be used for selection background. This creates a small distinction between the active crumb and the others that didn't previously exist. 7. frame.yaml.(keyColor|colonColor|valueColor) are changed to match yaml syntax highlighting from other modules such as bat. 8. frame.logs.indicator.bgColor from base0C to "default" to fix another very low contrast problem of having base05 text on a base0C background. 9. frame.logs.indicator.toggle(On|Off)Color weren't set before, so I made them base0B and base04 because base0B is customarily green or an "on" color, and base04 is the alternate text color. In the frame.status section I changed newColor, modifyColor, addColor, and errorColor. I left highlightColor, killColor, and completedColor as they were. 1. newColor is the color of all resources in a normal state. I chose base0C as a neutral color for this. Anything would have been better than the base08 (typically red) that it was. 2. modifyColor is the color of a resource when it's in some transitioning state. I could have made this base09 or base0A, but given that base0A is used for many other things I went with base09. 3. addColor is the color of a resource when it first appears. Using base0C (typically green) is customary for something like this. It had been base09 (typically orange) which has the opposite meaning. 4. errorColor is given to resources in an error state. This is the perfect place to use base08 according to the style guide. Link: https://github.com/danth/stylix/pull/999 Reviewed-by: Marc Jakobi Reviewed-by: NAHO <90870942+trueNAHO@users.noreply.github.com> --- modules/k9s/hm.nix | 122 +++++++++++++++++++++++-------------------- modules/k9s/meta.nix | 3 +- 2 files changed, 66 insertions(+), 59 deletions(-) diff --git a/modules/k9s/hm.nix b/modules/k9s/hm.nix index 127e9f3f..7ab695c0 100644 --- a/modules/k9s/hm.nix +++ b/modules/k9s/hm.nix @@ -1,72 +1,76 @@ -{ config, lib, ... }: +{ + config, + lib, + ... +}: { options.stylix.targets.k9s.enable = config.lib.stylix.mkEnableTarget "k9s" true; - config = lib.mkIf config.stylix.targets.k9s.enable { - programs.k9s.skins.skin = with config.lib.stylix.colors.withHashtag; { - k9s = { + config = lib.mkIf (config.stylix.enable && config.stylix.targets.k9s.enable) { + programs.k9s.skins.skin = { + k9s = with config.lib.stylix.colors.withHashtag; { body = { - fgColor = base05-hex; + fgColor = base05; bgColor = "default"; - logoColor = base0C-hex; + logoColor = base0C; }; prompt = { - fgColor = base05-hex; - bgColor = base00-hex; - suggestColor = base0A-hex; + fgColor = base05; + bgColor = "default"; + suggestColor = base02; }; info = { - fgColor = base0B-hex; - sectionColor = base05-hex; + fgColor = base0B; + sectionColor = base05; }; dialog = { - fgColor = base05-hex; - bgColor = "default"; - buttonFgColor = base05-hex; - buttonBgColor = base0C-hex; - buttonFocusFgColor = base0E-hex; - buttonFocusBgColor = base0B-hex; - labelFgColor = base0A-hex; - fieldFgColor = base05-hex; + fgColor = base05; + bgColor = base01; + buttonFgColor = base05; + buttonBgColor = base02; + buttonFocusFgColor = base11; + buttonFocusBgColor = base0B; + labelFgColor = base0A; + fieldFgColor = base05; }; frame = { border = { - fgColor = base02-hex; - focusColor = base01-hex; + fgColor = base02; + focusColor = base01; }; menu = { - fgColor = base05-hex; - keyColor = base0B-hex; - numKeyColor = base0B-hex; + fgColor = base05; + keyColor = base0B; + numKeyColor = base0B; }; crumbs = { - fgColor = base05-hex; - bgColor = base01-hex; - activeColor = base01-hex; + fgColor = base05; + bgColor = base01; + activeColor = base02; }; status = { - newColor = base08-hex; - modifyColor = base0C-hex; - addColor = base09-hex; - errorColor = base0D-hex; - highlightcolor = base0A-hex; - killColor = base03-hex; - completedColor = base03-hex; + newColor = base0C; + modifyColor = base09; + addColor = base0B; + errorColor = base08; + highlightcolor = base0A; + killColor = base03; + completedColor = base03; }; title = { - fgColor = base05-hex; - bgColor = base01-hex; - highlightColor = base0A-hex; - counterColor = base0C-hex; - filterColor = base0B-hex; + fgColor = base05; + bgColor = base01; + highlightColor = base0A; + counterColor = base0C; + filterColor = base0B; }; }; @@ -74,52 +78,54 @@ charts = { bgColor = "default"; defaultDialColors = [ - base0C-hex - base0D-hex + base0C + base0D ]; defaultChartColors = [ - base0C-hex - base0D-hex + base0C + base0D ]; }; table = { - fgColor = base05-hex; + fgColor = base05; bgColor = "default"; header = { - fgColor = base05-hex; + fgColor = base05; bgColor = "default"; - sorterColor = base08-hex; + sorterColor = base08; }; }; xray = { - fgColor = base05-hex; + fgColor = base05; bgColor = "default"; - cursorColor = base01-hex; - graphicColor = base0C-hex; + cursorColor = base01; + graphicColor = base0C; showIcons = false; }; yaml = { - keyColor = base0B-hex; - colonColor = base0C-hex; - valueColor = base05-hex; + keyColor = base08; + colonColor = base05; + valueColor = base0B; }; logs = { - fgColor = base05-hex; + fgColor = base05; bgColor = "default"; indicator = { - fgColor = base05-hex; - bgColor = base0C-hex; + fgColor = base05; + bgColor = "default"; + toggleOnColor = base0B; + toggleOffColor = base04; }; }; help = { - fgColor = base05-hex; - bgColor = base00-hex; - indicator.fgColor = base0D-hex; + fgColor = base05; + bgColor = "default"; + indicator.fgColor = base0D; }; }; }; diff --git a/modules/k9s/meta.nix b/modules/k9s/meta.nix index 51e10e61..d3b3a7a3 100644 --- a/modules/k9s/meta.nix +++ b/modules/k9s/meta.nix @@ -1,3 +1,4 @@ +{ lib, ... }: { - maintainers = [ ]; + maintainers = [ lib.maintainers.cluther ]; } From f122d70925ca44e5ee4216661769437ab36a6a3f Mon Sep 17 00:00:00 2001 From: awwpotato <153149335+awwpotato@users.noreply.github.com> Date: Wed, 19 Mar 2025 15:14:04 -0700 Subject: [PATCH 12/62] avizo: hotfix aviOpcaity missing (#1023) Closes: https://github.com/danth/stylix/issues/1018 Fixes: ff9ae322bcae ("treewide: clean up `with` and stuff (#975)") Link: https://github.com/danth/stylix/pull/1023 Reviewed-by: NAHO <90870942+trueNAHO@users.noreply.github.com> --- modules/avizo/hm.nix | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/modules/avizo/hm.nix b/modules/avizo/hm.nix index 7f831b0a..83633a0a 100644 --- a/modules/avizo/hm.nix +++ b/modules/avizo/hm.nix @@ -13,13 +13,18 @@ lib.mkIf (config.stylix.enable && config.stylix.targets.avizo.enable) { services.avizo = { settings = { - default = with config.lib.stylix.colors; { - background = "rgba(${base01-rgb-r}, ${base01-rgb-g}, ${base01-rgb-b}, ${aviOpacity})"; - border-color = "rgba(${base0D-rgb-r}, ${base0D-rgb-g}, ${base0D-rgb-b}, ${aviOpacity})"; - bar-fg-color = "rgba(${base05-rgb-r}, ${base05-rgb-g}, ${base05-rgb-b}, ${aviOpacity})"; - bar-bg-color = "rgba(${base01-rgb-r}, ${base01-rgb-g}, ${base01-rgb-b}, ${aviOpacity})"; - image-opacity = toString config.stylix.opacity.popups; - }; + default = + with config.lib.stylix.colors; + let + aviOpacity = toString config.stylix.opacity.popups; + in + { + background = "rgba(${base01-rgb-r}, ${base01-rgb-g}, ${base01-rgb-b}, ${aviOpacity})"; + border-color = "rgba(${base0D-rgb-r}, ${base0D-rgb-g}, ${base0D-rgb-b}, ${aviOpacity})"; + bar-fg-color = "rgba(${base05-rgb-r}, ${base05-rgb-g}, ${base05-rgb-b}, ${aviOpacity})"; + bar-bg-color = "rgba(${base01-rgb-r}, ${base01-rgb-g}, ${base01-rgb-b}, ${aviOpacity})"; + image-opacity = aviOpacity; + }; }; }; } From 07c4f39b5b8d19930235cacbc05600fdcf1a2551 Mon Sep 17 00:00:00 2001 From: awwpotato <153149335+awwpotato@users.noreply.github.com> Date: Thu, 20 Mar 2025 09:02:49 -0700 Subject: [PATCH 13/62] halloy: add copyright notice (#1035) fixes #1034 --- modules/halloy/template.toml.mustache | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/halloy/template.toml.mustache b/modules/halloy/template.toml.mustache index bc1b9de2..0dd0ff02 100644 --- a/modules/halloy/template.toml.mustache +++ b/modules/halloy/template.toml.mustache @@ -1,6 +1,7 @@ ## Base16 {{scheme-name}} # Author: {{scheme-author}} # Generated by Stylix +# Copyright (c) 2024 Calvin Lee # Original template from https://github.com/4e554c4c/base16-halloy [general] From 64b4369b6b24751c555d5bf887b52d6dbc419c6f Mon Sep 17 00:00:00 2001 From: Daniel Thwaites Date: Thu, 20 Mar 2025 16:05:36 +0000 Subject: [PATCH 14/62] doc: display module maintainers (#1010) As promised at https://github.com/danth/stylix/pull/977#pullrequestreview-2683388232, this lists the maintainers for each module on its page in the docs. This includes some fixes to `stylix/meta.nix`: swapped the order of arguments to `mapAttrs`, and added an `import` to load the meta file rather than returning its path. --- docs/default.nix | 132 +++++++++++++++++++++++++++++++++++++---------- stylix/meta.nix | 14 ++--- 2 files changed, 114 insertions(+), 32 deletions(-) diff --git a/docs/default.nix b/docs/default.nix index b56396e2..cc94fa30 100644 --- a/docs/default.nix +++ b/docs/default.nix @@ -3,7 +3,7 @@ lib, inputs, ... -}: +}@args: let nixosConfiguration = lib.nixosSystem { @@ -43,13 +43,20 @@ let }; }; + metadata = import "${inputs.self}/stylix/meta.nix" args; + # We construct an index of all Stylix options, using the following format: # # { # "src/options/modules/«module».md" = { # referenceSection = "Modules"; - # readme = "modules/«module»/README.md"; - # defaultReadme = "note about the path above not existing"; + # readme = '' + # Content of modules/«module»/README.md, or a default title + # followed by a note about that file not existing. + # + # Summary of module maintainers, or a warning that the module + # is unmaintained. + # ''; # optionsByPlatform = { # home_manager = [ ... ]; # nixos = [ ... ]; @@ -58,8 +65,10 @@ let # # "src/options/platforms/«platform».md" = { # referenceSection = "Platforms"; - # readme = "docs/src/options/platforms/«platform».md"; - # defaultReadme = "note about the path above not existing"; + # readme = '' + # Content of docs/src/options/platforms/«platform».md, or a default + # title followed by a note about that file not existing. + # ''; # optionsByPlatform.«platform» = [ ... ]; # }; # } @@ -119,13 +128,79 @@ let page = "src/options/modules/${module}.md"; emptyPage = { referenceSection = "Modules"; - readme = "${inputs.self}/modules/${module}/README.md"; - defaultReadme = '' - # ${module} - > [!NOTE] - > This module doesn't include any additional documentation. You - > can browse the options it provides below. - ''; + + readme = + let + path = "${inputs.self}/modules/${module}/README.md"; + + # This doesn't count as IFD because ${inputs.self} is a flake input + mainText = + if builtins.pathExists path then + builtins.readFile path + else + '' + # ${module} + > [!NOTE] + > This module doesn't include any additional documentation. + > You can browse the options it provides below. + ''; + + inherit (metadata.${module}) maintainers; + + # Render a maintainer's name and a link to the best contact + # information we have for them. + # + # The reasoning behind the order of preference is as follows: + # + # - GitHub: + # - May link to multiple contact methods + # - More likely to have up-to-date information than the + # maintainers list + # - Protects the email address from crawlers + # - Email: + # - Very commonly used + # - Matrix: + # - Only other contact method in the schema + # (as of March 2025) + # - Name: + # - If no other information is available, then just show + # the maintainer's name without a link + renderMaintainer = + maintainer: + if maintainer ? github then + "[${maintainer.name}](https://github.com/${maintainer.github})" + else if maintainer ? email then + "[${maintainer.name}](mailto:${maintainer.email})" + else if maintainer ? matrix then + "[${maintainer.name}](https://matrix.to/#/${maintainer.matrix})" + else + maintainer.name; + + joinItems = + items: + if builtins.length items <= 2 then + builtins.concatStringsSep " and " items + else + builtins.concatStringsSep ", " ( + lib.dropEnd 1 items ++ [ "and ${lib.last items}" ] + ); + + renderedMaintainers = joinItems (map renderMaintainer maintainers); + + maintainersText = + if maintainers == [ ] then + '' + > [!WARNING] + > This module has no [dedicated maintainers](../../modules.md#maintainers). + '' + else + "This module is maintained by ${renderedMaintainers}."; + in + lib.concatLines [ + mainText + maintainersText + ]; + # Module pages initialise all platforms to an empty list, so that # '*None provided.*' indicates platforms where the module isn't # available. @@ -138,13 +213,24 @@ let page = "src/options/platforms/${platform}.md"; emptyPage = { referenceSection = "Platforms"; - readme = "${inputs.self}/docs/src/options/platforms/${platform}.md"; - defaultReadme = '' - # ${platform.name} - > Documentation is not available for this platform. Its main - > options are listed below, and you may find more specific options - > in the documentation for each module. - ''; + readme = + let + path = "${inputs.self}/docs/src/options/platforms/${platform}.md"; + + # This doesn't count as IFD because ${inputs.self} is a flake input + mainText = + if builtins.pathExists path then + builtins.readFile path + else + '' + # ${platform.name} + > Documentation is not available for this platform. Its + > main options are listed below, and you may find more + > specific options in the documentation for each module. + ''; + in + mainText; + # Platform pages only initialise that platform, since showing other # platforms here would be nonsensical. optionsByPlatform.${platform} = [ ]; @@ -328,18 +414,12 @@ let renderPage = _path: page: let - readme = - # This doesn't count as IFD because ${inputs.self} is a flake input - if builtins.pathExists page.readme then - builtins.readFile page.readme - else - page.defaultReadme; options = lib.concatStrings ( lib.mapAttrsToList renderPlatform page.optionsByPlatform ); in lib.concatLines [ - readme + page.readme options ]; diff --git a/stylix/meta.nix b/stylix/meta.nix index 5b68b6c4..4bedd1b2 100644 --- a/stylix/meta.nix +++ b/stylix/meta.nix @@ -5,12 +5,6 @@ ... }: builtins.mapAttrs - (lib.concatMapAttrs ( - path: kind: - lib.optionalAttrs (kind == "directory") { - ${path} = "${inputs.self}/modules/${path}/meta.nix"; - } - ) (builtins.readDir "${inputs.self}/modules")) ( _: value: if (builtins.typeOf value == "lambda") then @@ -25,3 +19,11 @@ builtins.mapAttrs else value ) + ( + lib.concatMapAttrs ( + path: kind: + lib.optionalAttrs (kind == "directory") { + ${path} = import "${inputs.self}/modules/${path}/meta.nix"; + } + ) (builtins.readDir "${inputs.self}/modules") + ) From 7e9906679d384472849272e5a5eef7adbdb1d87f Mon Sep 17 00:00:00 2001 From: awwpotato <153149335+awwpotato@users.noreply.github.com> Date: Thu, 20 Mar 2025 11:56:23 -0700 Subject: [PATCH 15/62] stylix: check whether maintainers list is sorted (#1014) Link: https://github.com/danth/stylix/pull/1014 Reviewed-by: NAHO <90870942+trueNAHO@users.noreply.github.com> --- flake.nix | 2 + stylix/check-maintainers-sorted.nix | 87 +++++++++++++++++++++++++++++ 2 files changed, 89 insertions(+) create mode 100644 stylix/check-maintainers-sorted.nix diff --git a/flake.nix b/flake.nix index fd6ee111..d19a2f12 100644 --- a/flake.nix +++ b/flake.nix @@ -148,6 +148,8 @@ src = ./.; }; + + maintainers-sorted = (import ./stylix/check-maintainers-sorted.nix) pkgs; } self.packages.${system}; devShells = { diff --git a/stylix/check-maintainers-sorted.nix b/stylix/check-maintainers-sorted.nix new file mode 100644 index 00000000..cf990291 --- /dev/null +++ b/stylix/check-maintainers-sorted.nix @@ -0,0 +1,87 @@ +# slight modification from nixpkgs's script: https://github.com/NixOS/nixpkgs/commit/4a694fc50007076566a204d6ea623fd5fc7ddbfa +pkgs: +let + inherit (pkgs.lib) + add + attrNames + attrValues + elemAt + foldl' + genList + length + replaceStrings + sort + toLower + trace + ; + + maintainers = import ./maintainers.nix; + simplify = replaceStrings [ "-" "_" ] [ "" "" ]; + namesSorted = sort (a: b: a.key < b.key) ( + map ( + n: + let + pos = builtins.unsafeGetAttrPos n maintainers; + in + assert pos == null -> throw "maintainers entry ${n} is malformed"; + { + name = n; + inherit (pos) line; + key = toLower (simplify n); + } + ) (attrNames maintainers) + ); + before = + { + key, + ... + }: + foldl' ( + acc: n: if n.key < key && (acc == null || n.key > acc.key) then n else acc + ) null namesSorted; + errors = foldl' add 0 ( + map ( + i: + let + a = elemAt namesSorted i; + b = elemAt namesSorted (i + 1); + lim = + let + t = before a; + in + if t == null then "the initial {" else t.name; + in + if a.line >= b.line then + trace ( + "maintainer ${a.name} (line ${toString a.line}) should be listed " + + "after ${lim}, not after ${b.name} (line ${toString b.line})" + ) 1 + else + 0 + ) (genList (i: i) (length namesSorted - 1)) + ); +in +assert length (attrValues maintainers) < 1 || errors == 0; +pkgs.runCommandLocal "maintainers-sorted" { } "mkdir $out" + +# generate edit commands to sort the list. +# may everything following the last current entry (closing } ff) in the wrong place +# with lib; +# concatStringsSep +# "\n" +# (let first = foldl' (acc: n: if n.line < acc then n.line else acc) 999999999 namesSorted; +# commands = map +# (i: let e = elemAt namesSorted i; +# begin = foldl' +# (acc: n: if n.line < e.line && n.line > acc then n.line else acc) +# 1 +# namesSorted; +# end = +# foldl' (acc: n: if n.line > e.line && n.line < acc then n.line else acc) +# 999999999 +# namesSorted; +# in "${toString e.line},${toString (end - 1)} p") +# (genList (i: i) (length namesSorted)); +# in map +# (c: "sed -ne '${c}' maintainers/maintainer-list.nix") +# ([ "1,${toString (first - 1)} p" ] ++ commands)) From 113643f332e1f70d90991722f8c4e5a0ace6fd06 Mon Sep 17 00:00:00 2001 From: Flameopathic <64027365+Flameopathic@users.noreply.github.com> Date: Fri, 21 Mar 2025 17:11:03 -0400 Subject: [PATCH 16/62] doc: add note for user-imported modules (#1039) Adds basic documentation to every Stylix module which requires a user-imported module to function. Intended to prevent issues like #1033 --- modules/discord/README.md | 9 +++++++++ modules/nixvim/README.md | 11 +++++++++++ modules/nvf/README.md | 10 ++++++++++ modules/spicetify/README.md | 11 +++++++++++ 4 files changed, 41 insertions(+) create mode 100644 modules/discord/README.md create mode 100644 modules/nixvim/README.md create mode 100644 modules/nvf/README.md create mode 100644 modules/spicetify/README.md diff --git a/modules/discord/README.md b/modules/discord/README.md new file mode 100644 index 00000000..42cfeab5 --- /dev/null +++ b/modules/discord/README.md @@ -0,0 +1,9 @@ +# Discord + +## Nixcord + +This Stylix module leverages the modules provided the +[Nixcord flake](https://github.com/KaylorBen/nixcord). Ensure that the Nixcord +Home Manager module is properly +[imported](https://github.com/KaylorBen/nixcord?tab=readme-ov-file#how-to-use-nixcord) +into your user configuration if you wish for the Stylix module to function. diff --git a/modules/nixvim/README.md b/modules/nixvim/README.md new file mode 100644 index 00000000..b66ad608 --- /dev/null +++ b/modules/nixvim/README.md @@ -0,0 +1,11 @@ +# Nixvim + +This Stylix module leverages the modules provided by +[Nixvim](https://github.com/nix-community/nixvim). Ensure that the desired +Nixvim module is properly +[installed](https://github.com/nix-community/nixvim?tab=readme-ov-file#installation) +and +[imported](https://github.com/nix-community/nixvim?tab=readme-ov-file#usage) +into your user configuration. When configuring `stylix.targets.nixvim` options, +ensure that you are configuring them in the same scope (NixOS, Home Manager, +Darwin) as you imported the Nixvim module. diff --git a/modules/nvf/README.md b/modules/nvf/README.md new file mode 100644 index 00000000..08db01b9 --- /dev/null +++ b/modules/nvf/README.md @@ -0,0 +1,10 @@ +# NVF + +This Stylix module leverages the modules provided by +[NVF](https://github.com/NotAShelf/nvf). Ensure that the desired NVF module is +properly +[installed](https://notashelf.github.io/nvf/index.xhtml#ch-installation) and +[imported](https://notashelf.github.io/nvf/index.xhtml#ch-module-installation) +into your user configuration. When configuring `stylix.targets.nvf` options, +ensure that you are configuring them in the same scope (NixOS, Home Manager, +Darwin) as you imported the NVF module. diff --git a/modules/spicetify/README.md b/modules/spicetify/README.md new file mode 100644 index 00000000..f3e829f6 --- /dev/null +++ b/modules/spicetify/README.md @@ -0,0 +1,11 @@ +# Spicetify + +This Stylix module leverages the modules provided by +[Spicetify-Nix](https://github.com/Gerg-L/spicetify-nix). Ensure that the +desired Spicetify module is properly +[installed](https://github.com/Gerg-L/spicetify-nix?tab=readme-ov-file#usage) +and +[imported](https://github.com/Gerg-L/spicetify-nix?tab=readme-ov-file#modules) +into your user configuration. When configuring `stylix.targets.spicetify` +options, ensure that you are configuring them in the same scope (NixOS, +Home Manager, Darwin) as you imported the Spicetify module. From f537d507c3ac287ee0cbf36b7e514c403daed0f8 Mon Sep 17 00:00:00 2001 From: Daniel Thwaites Date: Sun, 23 Mar 2025 13:23:39 +0000 Subject: [PATCH 17/62] doc: add subheading before module metadata (#1042) This avoids the metadata looking like part of a README subheading. --- docs/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/default.nix b/docs/default.nix index cc94fa30..d474e7ac 100644 --- a/docs/default.nix +++ b/docs/default.nix @@ -198,6 +198,7 @@ let in lib.concatLines [ mainText + "## Module information" maintainersText ]; From a55488c247928380ee6a18c0a3a56a2d52fe06bc Mon Sep 17 00:00:00 2001 From: Daniel Thwaites Date: Sun, 23 Mar 2025 13:25:15 +0000 Subject: [PATCH 18/62] doc: reduce overuse of alerts (#1041) Using too many "info" and "warning" boxes makes them less effective when they're needed to draw attention to something genuinely important. This commit adds important boxes to modules which require an external module to be imported, similar to the box already used on the "Firefox and derivatives" page. It changes the warning when a module has no maintainers to a regular paragraph. The note about `stylix.enable` being new is removed, since this has been around for a while now. --- docs/default.nix | 6 ++---- docs/src/configuration.md | 8 +------- modules/discord/README.md | 22 +++++++++++++++++----- modules/nixvim/README.md | 19 +++++++++++-------- modules/nvf/README.md | 18 +++++++++++------- modules/spicetify/README.md | 19 +++++++++++-------- 6 files changed, 53 insertions(+), 39 deletions(-) diff --git a/docs/default.nix b/docs/default.nix index d474e7ac..dacb0978 100644 --- a/docs/default.nix +++ b/docs/default.nix @@ -189,10 +189,7 @@ let maintainersText = if maintainers == [ ] then - '' - > [!WARNING] - > This module has no [dedicated maintainers](../../modules.md#maintainers). - '' + "This module has no [dedicated maintainers](../../modules.md#maintainers)." else "This module is maintained by ${renderedMaintainers}."; in @@ -225,6 +222,7 @@ let else '' # ${platform.name} + > [!NOTE] > Documentation is not available for this platform. Its > main options are listed below, and you may find more > specific options in the documentation for each module. diff --git a/docs/src/configuration.md b/docs/src/configuration.md index b1a813e6..ba121c5a 100644 --- a/docs/src/configuration.md +++ b/docs/src/configuration.md @@ -2,7 +2,7 @@ ## Enable -To enable the Stylix module, declare: +Stylix must be enabled before it will apply any changes to your system: ```nix { @@ -10,12 +10,6 @@ To enable the Stylix module, declare: } ``` -> [!NOTE] -> -> The global enable option was recently added, so you may come across old -> examples which don't include it. No other settings will take effect unless -> `stylix.enable` is set to `true`. - ## Color scheme ### Handmade schemes diff --git a/modules/discord/README.md b/modules/discord/README.md index 42cfeab5..f5249219 100644 --- a/modules/discord/README.md +++ b/modules/discord/README.md @@ -1,9 +1,21 @@ # Discord +This module provides a collection of targets related to +[Discord](https://discord.com/). The same theme is used regardless of the +method of installation. + +## Vencord, Vesktop + +These targets use the options for [Vencord](https://vencord.dev/) and +[Vesktop](https://github.com/Vencord/Vesktop#readme) which are built in +to Home Manager. + ## Nixcord -This Stylix module leverages the modules provided the -[Nixcord flake](https://github.com/KaylorBen/nixcord). Ensure that the Nixcord -Home Manager module is properly -[imported](https://github.com/KaylorBen/nixcord?tab=readme-ov-file#how-to-use-nixcord) -into your user configuration if you wish for the Stylix module to function. +This target leverages the modules provided the +[Nixcord flake](https://github.com/KaylorBen/nixcord). + +> [!IMPORTANT] +> The Nixcord target will have no effect unless Nixcord is properly +> [imported](https://github.com/KaylorBen/nixcord?tab=readme-ov-file#how-to-use-nixcord) +> into your configuration. diff --git a/modules/nixvim/README.md b/modules/nixvim/README.md index b66ad608..0920dbc1 100644 --- a/modules/nixvim/README.md +++ b/modules/nixvim/README.md @@ -1,11 +1,14 @@ # Nixvim This Stylix module leverages the modules provided by -[Nixvim](https://github.com/nix-community/nixvim). Ensure that the desired -Nixvim module is properly -[installed](https://github.com/nix-community/nixvim?tab=readme-ov-file#installation) -and -[imported](https://github.com/nix-community/nixvim?tab=readme-ov-file#usage) -into your user configuration. When configuring `stylix.targets.nixvim` options, -ensure that you are configuring them in the same scope (NixOS, Home Manager, -Darwin) as you imported the Nixvim module. +[Nixvim](https://github.com/nix-community/nixvim). + +> [!IMPORTANT] +> This module will have no effect unless the desired Nixvim module is properly +> [installed](https://github.com/nix-community/nixvim?tab=readme-ov-file#installation) +> and +> [imported](https://github.com/nix-community/nixvim?tab=readme-ov-file#usage) +> into your configuration. +> +> Ensure you are configuring this module on the same platform (NixOS, Home +> Manager, Darwin) as where you installed Nixvim. diff --git a/modules/nvf/README.md b/modules/nvf/README.md index 08db01b9..73d01ecd 100644 --- a/modules/nvf/README.md +++ b/modules/nvf/README.md @@ -1,10 +1,14 @@ # NVF This Stylix module leverages the modules provided by -[NVF](https://github.com/NotAShelf/nvf). Ensure that the desired NVF module is -properly -[installed](https://notashelf.github.io/nvf/index.xhtml#ch-installation) and -[imported](https://notashelf.github.io/nvf/index.xhtml#ch-module-installation) -into your user configuration. When configuring `stylix.targets.nvf` options, -ensure that you are configuring them in the same scope (NixOS, Home Manager, -Darwin) as you imported the NVF module. +[NVF](https://github.com/NotAShelf/nvf). + +> [!IMPORTANT] +> This module will have no effect unless the desired NVF module is properly +> [installed](https://notashelf.github.io/nvf/index.xhtml#ch-installation) +> and +> [imported](https://notashelf.github.io/nvf/index.xhtml#ch-module-installation) +> into your configuration. +> +> Ensure you are configuring this module on the same platform (NixOS, Home +> Manager, Darwin) as where you installed NVF. diff --git a/modules/spicetify/README.md b/modules/spicetify/README.md index f3e829f6..c40b3a48 100644 --- a/modules/spicetify/README.md +++ b/modules/spicetify/README.md @@ -1,11 +1,14 @@ # Spicetify This Stylix module leverages the modules provided by -[Spicetify-Nix](https://github.com/Gerg-L/spicetify-nix). Ensure that the -desired Spicetify module is properly -[installed](https://github.com/Gerg-L/spicetify-nix?tab=readme-ov-file#usage) -and -[imported](https://github.com/Gerg-L/spicetify-nix?tab=readme-ov-file#modules) -into your user configuration. When configuring `stylix.targets.spicetify` -options, ensure that you are configuring them in the same scope (NixOS, -Home Manager, Darwin) as you imported the Spicetify module. +[Spicetify-Nix](https://github.com/Gerg-L/spicetify-nix). + +> [!IMPORTANT] +> This module will have no effect unless the desired Spicetify module is properly +> [installed](https://github.com/Gerg-L/spicetify-nix?tab=readme-ov-file#usage) +> and +> [imported](https://github.com/Gerg-L/spicetify-nix?tab=readme-ov-file#modules) +> into your configuration. +> +> Ensure you are configuring this module on the same platform (NixOS, Home +> Manager, Darwin) as where you installed Spicetify. From d9df91c55643a8b5229a3ae3a496a30f14965457 Mon Sep 17 00:00:00 2001 From: Flameopathic <64027365+Flameopathic@users.noreply.github.com> Date: Sun, 23 Mar 2025 14:12:42 -0400 Subject: [PATCH 19/62] vscode: theme default profile by default (#1015) --- modules/vscode/hm.nix | 4 ++-- modules/vscode/testbeds/default.nix | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/modules/vscode/hm.nix b/modules/vscode/hm.nix index c3b41e96..39828d4e 100644 --- a/modules/vscode/hm.nix +++ b/modules/vscode/hm.nix @@ -38,7 +38,7 @@ in profileNames = lib.mkOption { description = "The VSCode profile names to apply styling on."; type = lib.types.listOf lib.types.str; - default = [ ]; + default = [ "default" ]; }; }; @@ -47,6 +47,6 @@ in warnings = lib.optional (config.programs.vscode.enable && cfg.profileNames == [ ]) - ''stylix: vscode: `config.stylix.targets.vscode.profileNames` is not set. Declare profile names with 'config.stylix.targets.vscode.profileNames = [ "" ];'.''; + ''stylix: vscode: `config.stylix.targets.vscode.profileNames` is empty. No theming will be applied. Add a profile or disable this warning by setting `stylix.targets.vscode.enable = false`.''; }; } diff --git a/modules/vscode/testbeds/default.nix b/modules/vscode/testbeds/default.nix index 6c0df350..9384638a 100644 --- a/modules/vscode/testbeds/default.nix +++ b/modules/vscode/testbeds/default.nix @@ -16,7 +16,5 @@ in enable = true; inherit package; }; - - stylix.targets.vscode.profileNames = [ "default" ]; }; } From 20349ced5c2c23c152bbfee1665001378585eb31 Mon Sep 17 00:00:00 2001 From: Flameopathic <64027365+Flameopathic@users.noreply.github.com> Date: Mon, 24 Mar 2025 18:22:11 -0400 Subject: [PATCH 20/62] doc: add GitHub issue templates (#921) Closes: https://github.com/danth/stylix/issues/268 Link: https://github.com/danth/stylix/pull/921 Co-authored-by: NAHO <90870942+trueNAHO@users.noreply.github.com> Co-authored-by: awwpotato <153149335+awwpotato@users.noreply.github.com> Reviewed-by: NAHO <90870942+trueNAHO@users.noreply.github.com> --- .github/ISSUE_TEMPLATE/bug.yml | 113 +++++++++++++++++++++++ .github/ISSUE_TEMPLATE/change_option.yml | 43 +++++++++ .github/ISSUE_TEMPLATE/change_target.yml | 43 +++++++++ .github/ISSUE_TEMPLATE/new_option.yml | 43 +++++++++ .github/ISSUE_TEMPLATE/new_target.yml | 32 +++++++ 5 files changed, 274 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug.yml create mode 100644 .github/ISSUE_TEMPLATE/change_option.yml create mode 100644 .github/ISSUE_TEMPLATE/change_target.yml create mode 100644 .github/ISSUE_TEMPLATE/new_option.yml create mode 100644 .github/ISSUE_TEMPLATE/new_target.yml diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml new file mode 100644 index 00000000..2858f06d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -0,0 +1,113 @@ +--- +description: Report a bug +labels: [bug] +name: Bug +title: ": " + +body: + - type: checkboxes + + attributes: + label: I assert that this issue is relevant for Stylix + + description: >- + If you need help or are unsure whether this is a Stylix bug, please + consider reading the [documentation](https://stylix.danth.me) or asking + for help in a [GitHub + Discussion](https://github.com/danth/stylix/discussions) or the [Stylix + Matrix Room](https://matrix.to/#/#stylix:danth.me) before opening an + issue. + + options: + - label: >- + I assert that this is a bug and not a user error or support + request. + + required: true + + - label: >- + I assert that this is not a duplicate of an [existing + issue](https://github.com/danth/stylix/issues). + + required: true + + - type: textarea + + attributes: + description: >- + Describe the issue in detail. Consider including a minimal reproducible + example, logs, or screenshots. + + label: Description + + placeholder: Type your description here… + + validations: + required: true + + - type: textarea + + attributes: + description: >- + Copy-paste the `flake.lock` file. If flakes are not used, provide the + locked input versions. + + label: flake.lock + + placeholder: |- + { + "nodes": { + }, + "root": "root", + "version": 7 + } + + render: json + + validations: + required: true + + - type: dropdown + + attributes: + description: How is Stylix installed? + label: Installation Method + + options: + - NixOS + - Home Manager + - nix-darwin + - Nix-on-Droid + - Other + + validations: + required: true + + - type: textarea + + attributes: + description: "`nix-info --markdown` output." + label: System Information + + placeholder: |- + - system: + - host os: + - multi-user?: + - sandbox: + - version: + - nixpkgs: + + validations: + required: true + + - type: textarea + + attributes: + label: Notify maintainers + + description: >- + If this bug is module-specific, consider pinging its maintainers. Each + module lists its maintainers in the + [documentation](https://stylix.danth.me). + + placeholder: "@danth, @trueNAHO" diff --git a/.github/ISSUE_TEMPLATE/change_option.yml b/.github/ISSUE_TEMPLATE/change_option.yml new file mode 100644 index 00000000..2e01fe52 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/change_option.yml @@ -0,0 +1,43 @@ +--- +description: Request a change to an existing option +labels: [change-option] +name: Change option +title: ": " + +body: + - type: checkboxes + + attributes: + label: I assert that this feature request is relevant for Stylix + + options: + - label: >- + I assert that this is not a duplicate of an [existing feature + request](https://github.com/danth/stylix/issues). + + required: true + + - type: textarea + + attributes: + label: Description + + description: >- + Describe the change and its potential breaking changes, and demonstrate + the use case it improves. + + placeholder: Type your description here… + + validations: + required: true + + - type: textarea + + attributes: + label: Notify maintainers + + description: >- + Consider pinging the module maintainers. Each module lists its + maintainers in the [documentation](https://stylix.danth.me). + + placeholder: "@danth, @trueNAHO" diff --git a/.github/ISSUE_TEMPLATE/change_target.yml b/.github/ISSUE_TEMPLATE/change_target.yml new file mode 100644 index 00000000..463076b2 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/change_target.yml @@ -0,0 +1,43 @@ +--- +description: Request a change to an existing target +labels: [change-target] +name: Change target +title: ": " + +body: + - type: checkboxes + + attributes: + label: I assert that this feature request is relevant for Stylix + + options: + - label: >- + I assert that this is not a duplicate of an [existing feature + request](https://github.com/danth/stylix/issues). + + required: true + + - type: textarea + + attributes: + label: Description + + description: >- + Describe the change. Consider including links to potentially useful + NixOS, Home Manager, nix-darwin, or Nix-on-Droid options. + + placeholder: Type your description here… + + validations: + required: true + + - type: textarea + + attributes: + label: Notify maintainers + + description: >- + Consider pinging the module maintainers. Each module lists its + maintainers in the [documentation](https://stylix.danth.me). + + placeholder: "@danth, @trueNAHO" diff --git a/.github/ISSUE_TEMPLATE/new_option.yml b/.github/ISSUE_TEMPLATE/new_option.yml new file mode 100644 index 00000000..43197cec --- /dev/null +++ b/.github/ISSUE_TEMPLATE/new_option.yml @@ -0,0 +1,43 @@ +--- +description: Request the addition of a new option +labels: [new-option] +name: New option +title: ": add