Co-authored-by: mjallen18 <matt.l.jallen@gmail.com>
Reviewed-on: #3
This commit is contained in:
2025-12-01 17:26:26 -06:00
parent 672221f471
commit f172707b15
48 changed files with 851 additions and 1321 deletions

View File

@@ -1,191 +0,0 @@
{ config, lib, ... }:
with lib;
let
cfg = config.mjallen.theme;
mkPalettePath = name: lib.snowfall.fs.get-file "modules/home/desktop/theme/palettes/${name}.nix";
cap =
s:
let
len = builtins.stringLength s;
in
(lib.toUpper (builtins.substring 0 1 s)) + (builtins.substring 1 (len - 1) s);
in
{
options.mjallen.theme = {
name = mkOption {
type = types.enum [
"nord"
"dracula"
"everforest"
];
default = "nord";
description = "Global theme palette name.";
};
# This is the palette file other modules should import.
# It exports a normalized schema with colors, tokens, and compat maps.
paletteFile = mkOption {
type = types.path;
default = mkPalettePath "nord";
description = "Path to a palette nix file exporting a normalized schema (and compat maps).";
};
# Exposed tokens (derived from paletteFile)
tokens = mkOption {
type = types.attrs;
default = { };
description = "Derived tokens from the selected palette (set automatically).";
};
# Expose the imported palette (actual colors + compat groups)
palette = mkOption {
type = types.attrs;
default = { };
description = "Imported palette attrset from the selected paletteFile (set automatically).";
};
gtk = {
enable = mkOption {
type = types.bool;
default = true;
description = "Manage GTK theme using global theme settings.";
};
# e.g. Colloid-Dark-Compact-*
color = mkOption {
type = types.enum [
"dark"
"light"
];
default = "dark";
description = "GTK color variant.";
};
size = mkOption {
type = types.enum [
"standard"
"compact"
];
default = "compact";
description = "GTK size variant.";
};
accent = mkOption {
type = types.enum [
"default"
"purple"
"pink"
"red"
"orange"
"yellow"
"green"
"teal"
"grey"
"all"
];
default = "all";
description = "GTK accent (Colloid themeVariants).";
};
tweak = mkOption {
type = types.enum [
"normal"
"rimless"
"float"
"black"
];
default = "normal";
description = "GTK tweak (Colloid tweaks).";
};
themeName = mkOption {
type = types.nullOr types.str;
default = null;
description = "Explicit GTK theme name override. If null, computed from color/size/accent.";
};
};
icons = {
# Colloid icon scheme usually supports several named schemes. Default follows palette name.
scheme = mkOption {
type = types.enum [
"default"
"nord"
"dracula"
"gruvbox"
"everforest"
"catppuccin"
];
default = cfg.name;
description = "Icon scheme to use (Colloid schemeVariants).";
};
variant = mkOption {
type = types.enum [
"default"
"purple"
"pink"
"red"
"orange"
"yellow"
"green"
"teal"
"grey"
"all"
];
default = "all";
description = "Icon variant (Colloid colorVariants).";
};
themeName = mkOption {
type = types.nullOr types.str;
default = null;
description = "Explicit icon theme name override. If null, computed from scheme/variant.";
};
};
};
# Wire derived defaults that depend on other options.
config = {
# Keep paletteFile following the chosen name unless user overrides it explicitly.
mjallen.theme.paletteFile = mkDefault (mkPalettePath cfg.name);
# Pull tokens directly from the palette file for convenience
mjallen.theme.tokens = mkDefault (
let
pal = import cfg.paletteFile;
in
pal.tokens or { }
);
# Expose the imported palette for convenience
mjallen.theme.palette = mkDefault (import cfg.paletteFile);
# Default per-program palette path (can still be overridden per program)
mjallen.programs.waybar.theme.file = mkDefault cfg.paletteFile;
mjallen.programs.kitty.theme.file = mkDefault cfg.paletteFile;
mjallen.programs.mako.theme.file = mkDefault cfg.paletteFile;
mjallen.programs.wofi.theme.file = mkDefault cfg.paletteFile;
mjallen.programs.btop.theme.file = mkDefault cfg.paletteFile;
mjallen.programs.nwg-dock.theme.file = mkDefault cfg.paletteFile;
mjallen.programs.nwg-drawer.theme.file = mkDefault cfg.paletteFile;
mjallen.programs.wlogout.theme.file = mkDefault cfg.paletteFile;
# Computed GTK/Icon theme names if not overridden
_module.args.mjallenThemeComputed = {
gtkTheme =
if cfg.gtk.themeName != null then
cfg.gtk.themeName
else
"Colloid-${cap cfg.gtk.color}-${cap cfg.gtk.size}";
iconTheme =
if cfg.icons.themeName != null then
cfg.icons.themeName
else
"Colloid-${cap cfg.icons.scheme}-${cap cfg.gtk.color}";
};
};
}

View File

@@ -1,62 +0,0 @@
{
# Nord colors
# Opacity Hex alpha
# 100% FF
# 75% BF
# 50% 80
# 25% 40
# 10% 1A
# 0% 00
polarNight = {
nord0 = "#2e3440";
nord1 = "#3b4252";
nord2 = "#434c5e";
nord3 = "#4c566a";
};
snowStorm = {
nord4 = "#d8dee9";
nord5 = "#e5e9f0";
nord6 = "#eceff4";
};
frost = {
nord7 = "#8fbcbb";
nord8 = "#88c0d0";
nord9 = "#81a1c1";
nord10 = "#5e81ac";
};
aurora = {
nord11 = "#bf616a";
nord12 = "#d08770";
nord13 = "#ebcb8b";
nord14 = "#a3be8c";
nord15 = "#b48ead";
};
defaultOpacity = "opacity: 0.85;";
defaultBorderRadius = "border-radius: 1rem;";
defaultCenterOptions = ''
padding-top: 0.2rem;
padding-bottom: 0.2rem;
padding-left: 0.5rem;
padding-right: 0.5rem;
margin: 3px 0;
'';
borderRight = ''
padding-top: 0.2rem;
padding-bottom: 0.2rem;
padding-left: 0.5rem;
padding-right: 0.5rem;
margin: 3px 0;
border-radius: 0rem 1rem 1rem 0rem;
margin-right: 0.5rem;
'';
borderLeft = ''
padding-top: 0.2rem;
padding-bottom: 0.2rem;
padding-left: 0.5rem;
padding-right: 0.5rem;
margin: 3px 0;
border-radius: 1rem 0rem 0rem 1rem;
margin-left: 0.5rem;
'';
}

View File

@@ -1,90 +0,0 @@
rec {
# Normalized semantic colors (theme-agnostic) - Dracula
colors = {
bg = "#282a36";
bgAlt = "#343746";
surface = "#343746";
surfaceAlt = "#44475a";
border = "#44475a";
text = "#f8f8f2";
textMuted = "#e2e2dc";
primary = "#6272a4"; # dark blue
info = "#8be9fd"; # cyan
accent = "#bd93f9"; # purple
success = "#50fa7b"; # green
warning = "#f1fa8c"; # yellow
danger = "#ff5555"; # red
};
# Shared styling tokens for CSS consumers
tokens = {
opacity = "opacity: 0.90;";
borderRadius = "border-radius: 0.8rem;";
centerOptions = ''
padding-top: 0.25rem;
padding-bottom: 0.25rem;
padding-left: 0.5rem;
padding-right: 0.5rem;
margin: 3px 0;
'';
borderRight = ''
padding-top: 0.25rem;
padding-bottom: 0.25rem;
padding-left: 0.5rem;
padding-right: 0.5rem;
margin: 3px 0;
border-radius: 0rem 0.8rem 0.8rem 0rem;
margin-right: 0.5rem;
'';
borderLeft = ''
padding-top: 0.25rem;
padding-bottom: 0.25rem;
padding-left: 0.5rem;
padding-right: 0.5rem;
margin: 3px 0;
border-radius: 0.8rem 0rem 0rem 0.8rem;
margin-left: 0.5rem;
'';
};
# Legacy token aliases for back-compat
defaultOpacity = tokens.opacity;
defaultBorderRadius = tokens.borderRadius;
defaultCenterOptions = tokens.centerOptions;
borderRight = tokens.borderRight;
borderLeft = tokens.borderLeft;
# Back-compat: Nord-shaped groups for existing modules (approximate mappings)
polarNight = {
nord0 = "#282a36";
nord1 = "#343746";
nord2 = "#3b3e4a";
nord3 = "#44475a";
};
snowStorm = {
nord4 = "#e2e2dc";
nord5 = "#f1f1ea";
nord6 = "#f8f8f2";
};
frost = {
nord7 = "#50fa7b"; # using green as one of the frost group
nord8 = "#8be9fd"; # cyan
nord9 = "#6272a4"; # blue
nord10 = "#bd93f9"; # purple (as highlight)
};
aurora = {
nord11 = "#ff5555"; # red
nord12 = "#ffb86c"; # orange
nord13 = "#f1fa8c"; # yellow
nord14 = "#50fa7b"; # green
nord15 = "#bd93f9"; # magenta/purple
};
}

View File

@@ -1,90 +0,0 @@
rec {
# Normalized semantic colors (Everforest - Dark)
colors = {
bg = "#2b3339";
bgAlt = "#323c41";
surface = "#323c41";
surfaceAlt = "#3a444a";
border = "#414b51";
text = "#d3c6aa";
textMuted = "#9da9a0";
primary = "#7fbbb3"; # blue/aqua
info = "#83c092"; # teal
accent = "#d699b6"; # magenta
success = "#a7c080"; # green
warning = "#dbbc7f"; # yellow
danger = "#e67e80"; # red
};
# Shared styling tokens for CSS consumers
tokens = {
opacity = "opacity: 0.85;";
borderRadius = "border-radius: 1rem;";
centerOptions = ''
padding-top: 0.2rem;
padding-bottom: 0.2rem;
padding-left: 0.5rem;
padding-right: 0.5rem;
margin: 3px 0;
'';
borderRight = ''
padding-top: 0.2rem;
padding-bottom: 0.2rem;
padding-left: 0.5rem;
padding-right: 0.5rem;
margin: 3px 0;
border-radius: 0rem 1rem 1rem 0rem;
margin-right: 0.5rem;
'';
borderLeft = ''
padding-top: 0.2rem;
padding-bottom: 0.2rem;
padding-left: 0.5rem;
padding-right: 0.5rem;
margin: 3px 0;
border-radius: 1rem 0rem 0rem 1rem;
margin-left: 0.5rem;
'';
};
# Legacy token aliases for back-compat
defaultOpacity = tokens.opacity;
defaultBorderRadius = tokens.borderRadius;
defaultCenterOptions = tokens.centerOptions;
borderRight = tokens.borderRight;
borderLeft = tokens.borderLeft;
# Back-compat: Nord-shaped groups for existing modules (approximate mappings)
polarNight = {
nord0 = "#2b3339";
nord1 = "#323c41";
nord2 = "#3a444a";
nord3 = "#414b51";
};
snowStorm = {
nord4 = "#c6d0b5";
nord5 = "#e0dcc7";
nord6 = "#d3c6aa";
};
frost = {
nord7 = "#a7c080"; # green
nord8 = "#83c092"; # teal
nord9 = "#7fbbb3"; # aqua/blue
nord10 = "#7fbbb3"; # reuse
};
aurora = {
nord11 = "#e67e80"; # red
nord12 = "#e69875"; # orange
nord13 = "#dbbc7f"; # yellow
nord14 = "#a7c080"; # green
nord15 = "#d699b6"; # magenta
};
}

View File

@@ -1,90 +0,0 @@
rec {
# Normalized semantic colors (theme-agnostic)
colors = {
bg = "#2e3440";
bgAlt = "#3b4252";
surface = "#3b4252";
surfaceAlt = "#434c5e";
border = "#4c566a";
text = "#eceff4";
textMuted = "#e5e9f0";
primary = "#5e81ac"; # blue
info = "#88c0d0"; # cyan/teal
accent = "#b48ead"; # purple
success = "#a3be8c"; # green
warning = "#ebcb8b"; # yellow
danger = "#bf616a"; # red
};
# Shared styling tokens for CSS consumers
tokens = {
opacity = "opacity: 0.85;";
borderRadius = "border-radius: 1rem;";
centerOptions = ''
padding-top: 0.2rem;
padding-bottom: 0.2rem;
padding-left: 0.5rem;
padding-right: 0.5rem;
margin: 3px 0;
'';
borderRight = ''
padding-top: 0.2rem;
padding-bottom: 0.2rem;
padding-left: 0.5rem;
padding-right: 0.5rem;
margin: 3px 0;
border-radius: 0rem 1rem 1rem 0rem;
margin-right: 0.5rem;
'';
borderLeft = ''
padding-top: 0.2rem;
padding-bottom: 0.2rem;
padding-left: 0.5rem;
padding-right: 0.5rem;
margin: 3px 0;
border-radius: 1rem 0rem 0rem 1rem;
margin-left: 0.5rem;
'';
};
# Legacy token aliases for back-compat
defaultOpacity = tokens.opacity;
defaultBorderRadius = tokens.borderRadius;
defaultCenterOptions = tokens.centerOptions;
borderRight = tokens.borderRight;
borderLeft = tokens.borderLeft;
# Back-compat: Nord-shaped groups for existing modules
polarNight = {
nord0 = "#2e3440";
nord1 = "#3b4252";
nord2 = "#434c5e";
nord3 = "#4c566a";
};
snowStorm = {
nord4 = "#d8dee9";
nord5 = "#e5e9f0";
nord6 = "#eceff4";
};
frost = {
nord7 = "#8fbcbb";
nord8 = "#88c0d0";
nord9 = "#81a1c1";
nord10 = "#5e81ac";
};
aurora = {
nord11 = "#bf616a";
nord12 = "#d08770";
nord13 = "#ebcb8b";
nord14 = "#a3be8c";
nord15 = "#b48ead";
};
}