feat: dank themes module

This commit is contained in:
Nick 2025-01-14 16:17:42 -06:00
parent 616ce7fbca
commit 87b2f7e687
62 changed files with 1589 additions and 201 deletions

View file

@ -1,17 +1,319 @@
let
configPath = ./config;
currentTheme = catppuccin-macchiato;
# Catppuccin
catppuccin-latte = "catppuccin-latte";
catppuccin-frappe = "catppuccin-frappe";
catppuccin-macchiato = "catppuccin-macchiato";
catppuccin-mocha = "catppuccin-mocha";
# Dracula
dracula = "dracula";
# Gruvbox
gruvbox-dark = "gruvbox-dark";
gruvbox-light = "gruvbox-light";
# Material
material-darker = "material-darker";
material-deep-ocean = "material-deep-ocean";
material-forest = "material-forest";
material-lighter = "material-lighter";
material-oceanic = "material-oceanic";
material-palenight = "material-palenight";
material-sandy-beach = "material-sandy-beach";
material-sky-blue = "material-sky-blue";
material-space = "material-space";
material-volcano = "material-volcano";
# Nord
nord = "nord";
# One Dark
one-dark = "one-dark";
# Rosepine
rosepine = "rosepine";
rosepine-moon = "rosepine-moon";
rosepine-dawn = "rosepine-dawn";
# Tokyo Night
tokyo-night-night = "tokyo-night-night";
tokyo-night-storm = "tokyo-night-storm";
tokyo-night-day = "tokyo-night-day";
# Solorized
solorized-dark = "solorized-dark";
solorized-light = "solorized-light";
#
errorMessage = "Unknown theme: ${currentTheme}";
themeFunctions = {
dummy = [];
};
schemePath = ./schemes;
themes = builtins.listToAttrs (map (name: {
name = builtins.substring 0 (builtins.stringLength name - 4) name;
value = import (configPath + "/${name}") {inherit themeFunctions;};
})
(builtins.filter (name:
builtins.match ".*\\.nix$" name != null) (builtins.attrNames
(builtins.readDir configPath))));
mapColour =
# Catppuccin
catppuccin-latteColour: catppuccin-frappeColour: catppuccin-macchiatoColour: catppuccin-mochaColour:
# Dracula
draculaColour:
# Gruvbox
gruvbox-darkColour: gruvbox-lightColour:
# Material
material-darkerColour: material-deep-oceanColour: material-forestColour: material-lighterColour: material-oceanicColour: material-palenightColour: material-sandy-beachColour: material-sky-blueColour: material-spaceColour: material-volcanoColour:
# Nord
nordColour:
# One Dark
one-darkColour:
# Rosepine
rosepineColour: rosepine-moonColour: rosepine-dawnColour:
# Tokyo Night
tokyo-night-nightColor: tokyo-night-stormColor: tokyo-night-dayColor:
# Solorized
solorized-darkColour: solorized-lightColour:
# Catppuccin
if currentTheme == catppuccin-mocha
then catppuccin-mochaColour
else if currentTheme == catppuccin-macchiato
then catppuccin-macchiatoColour
else if currentTheme == catppuccin-frappe
then catppuccin-frappeColour
else if currentTheme == catppuccin-latte
then catppuccin-latteColour
# Dracula
else if currentTheme == dracula
then draculaColour
#Gruvbox
else if currentTheme == gruvbox-dark
then gruvbox-darkColour
else if currentTheme == gruvbox-light
then gruvbox-lightColour
# Material
else if currentTheme == material-darker
then material-darkerColour
else if currentTheme == material-deep-ocean
then material-deep-oceanColour
else if currentTheme == material-forest
then material-forestColour
else if currentTheme == material-lighter
then material-lighterColour
else if currentTheme == material-oceanic
then material-oceanicColour
else if currentTheme == material-palenight
then material-palenightColour
else if currentTheme == material-sandy-beach
then material-sandy-beachColour
else if currentTheme == material-sky-blue
then material-sky-blueColour
else if currentTheme == material-space
then material-spaceColour
else if currentTheme == material-volcano
then material-volcanoColour
# Nord
else if currentTheme == nord
then nordColour
# Nord
else if currentTheme == one-dark
then one-darkColour
# Rosepine
else if currentTheme == rosepine
then rosepineColour
else if currentTheme == rosepine-moon
then rosepine-moonColour
else if currentTheme == rosepine-dawn
then rosepine-dawnColour
# Solorized
else if currentTheme == solorized-dark
then solorized-darkColour
else if currentTheme == solorized-light
then solorized-lightColour
# Tokyo Night
else if currentTheme == tokyo-night-night
then tokyo-night-nightColor
else if currentTheme == tokyo-night-storm
then tokyo-night-stormColor
else if currentTheme == tokyo-night-day
then tokyo-night-dayColor
else throw errorMessage;
in {
themes = themes;
themes = {
currentTheme = currentTheme;
font = "MonaspiceRn Nerd Font";
schemes = let
catppuccinPath = /catppuccin;
gruvboxPath = /gruvbox;
materialPath = /material;
rosepinePath = /rosepine;
toyko-nightPath = /tokyo-night;
solarizedPath = /solarized;
in {
${catppuccin-frappe} = import (schemePath + catppuccinPath + /frappe);
${catppuccin-latte} = import (schemePath + catppuccinPath + /latte);
${catppuccin-macchiato} = import (schemePath + catppuccinPath + /macchiato);
${catppuccin-mocha} = import (schemePath + catppuccinPath + /mocha);
${dracula} = import (schemePath + /dracula);
${gruvbox-dark} = import (schemePath + gruvboxPath + /dark);
${gruvbox-light} = import (schemePath + gruvboxPath + /light);
${material-darker} = import (schemePath + materialPath + /darker);
${material-lighter} = import (schemePath + materialPath + /lighter);
${material-oceanic} = import (schemePath + materialPath + /oceanic);
${material-palenight} = import (schemePath + materialPath + /palenight);
${material-deep-ocean} = import (schemePath + materialPath + /deep-ocean);
${material-forest} = import (schemePath + materialPath + /forest);
${material-sky-blue} = import (schemePath + materialPath + /sky-blue);
${material-sandy-beach} = import (schemePath + materialPath + /sandy-beach);
${material-volcano} = import (schemePath + materialPath + /volcano);
${material-space} = import (schemePath + materialPath + /space);
${nord} = import (schemePath + /nord);
${one-dark} = import (schemePath + /one-dark);
${rosepine} = import (schemePath + rosepinePath + /base);
${rosepine-dawn} = import (schemePath + rosepinePath + /dawn);
${rosepine-moon} = import (schemePath + rosepinePath + /moon);
${tokyo-night-night} = import (schemePath + toyko-nightPath + /night);
${tokyo-night-storm} = import (schemePath + toyko-nightPath + /storm);
${tokyo-night-day} = import (schemePath + toyko-nightPath + /day);
${solorized-dark} = import (schemePath + solarizedPath + /dark);
${solorized-light} = import (schemePath + solarizedPath + /light);
};
currentColours = {
# Core Text Colours
text =
mapColour
"text" # catppuccin-macchiato
"text" # rosepine
"foreground"; #dracula
subtext1 =
mapColour
"subtext1"
"subtle"
"foreground";
subtext0 =
mapColour
"subtext0"
"muted"
"foreground";
# Background Colours
background0 =
mapColour
"crust"
"highlight0"
"background";
background1 =
mapColour
"base"
"base"
"background";
background2 =
mapColour
"mantle"
"surface"
"background";
# Surface Colours
surface0 =
mapColour
"surface0"
"highlight0"
"background";
surface1 =
mapColour
"surface1"
"highlight1"
"background";
surface2 =
mapColour
"surface2"
"highlight2"
"background";
# Overlay Colours
overlay0 =
mapColour
"overlay0"
"muted"
"background";
overlay1 =
mapColour
"overlay1"
"subtle"
"background";
overlay2 =
mapColour
"overlay2"
"subtle"
"background";
# Diagnostic Colours
error =
mapColour
"red"
"love"
"red";
warning =
mapColour
"yellow"
"gold"
"yellow";
noError =
mapColour
"green"
"pine"
"green";
# Warm Accent Colours
warmAccent0 =
mapColour
"rosewater"
"rose"
"pink";
warmAccent1 =
mapColour
"flamingo"
"rose"
"pink";
warmAccent2 =
mapColour
"mauve"
"iris"
"purple";
warmAccent3 =
mapColour
"maroon"
"love"
"orange";
warmAccent4 =
mapColour
"peach"
"gold"
"orange";
warmAccent5 =
mapColour
"pink"
"love"
"purple";
# Cool Accent Colours
coolAccent0 =
mapColour
"teal"
"foam"
"comment";
coolAccent1 =
mapColour
"sky"
"foam"
"cyan";
coolAccent2 =
mapColour
"sapphire"
"foam"
"cyan";
coolAccent3 =
mapColour
"blue"
"pine"
"comment";
coolAccent4 =
mapColour
"lavender"
"iris"
"cyan";
};
};
}