Start converting theme to use a centrally defined accent colour

accentColour defined in flake.nix and passed via specialArgs /
extraSpecialArgs to where it's needed

Still need to change the mustache configs but otherwise I think
everything has been changed
This commit is contained in:
Evie Litherland-Smith 2024-02-20 19:31:21 +00:00
parent 4874de6af7
commit 59b9fac674
5 changed files with 231 additions and 213 deletions

View file

@ -25,6 +25,9 @@
system = "x86_64-linux"; system = "x86_64-linux";
group = "users"; group = "users";
shell = "zsh"; shell = "zsh";
wallpaper = ./wallpapers/space.png;
base16Scheme = ./schemes/modus-vivendi-tinted.yaml;
accentColour = "base0E"; # magenta
systemModules = [./system/hyprland.nix]; systemModules = [./system/hyprland.nix];
serviceModules = []; serviceModules = [];
homeModules = [./home/hyprland/default.nix]; homeModules = [./home/hyprland/default.nix];
@ -36,12 +39,15 @@
system ? default.system, system ? default.system,
group ? default.group, group ? default.group,
shell ? default.shell, shell ? default.shell,
wallpaper ? default.wallpaper,
base16Scheme ? default.base16Scheme,
accentColour ? default.accentColour,
systemModules ? default.systemModules, systemModules ? default.systemModules,
serviceModules ? default.serviceModules, serviceModules ? default.serviceModules,
homeModules ? default.homeModules, homeModules ? default.homeModules,
stateVersion ? default.stateVersion, stateVersion ? default.stateVersion,
}: let }: let
specialArgs = {inherit hostName user group shell;}; specialArgs = {inherit hostName user group shell accentColour;};
in in
nixpkgs.lib.nixosSystem { nixpkgs.lib.nixosSystem {
inherit system specialArgs; inherit system specialArgs;
@ -152,14 +158,14 @@
firewall.enable = true; firewall.enable = true;
}; };
stylix = { stylix = {
inherit base16Scheme;
autoEnable = false; autoEnable = false;
targets = { targets = {
chromium.enable = true; chromium.enable = true;
console.enable = true; console.enable = true;
fish.enable = true; fish.enable = true;
}; };
image = ./wallpapers/sweet/Sweet-space.png; image = wallpaper;
base16Scheme = ./schemes/modus-vivendi-tinted.yaml;
polarity = "dark"; polarity = "dark";
opacity = { opacity = {
applications = 0.85; applications = 0.85;

View file

@ -1,13 +1,18 @@
{config, ...}: { {
config,
accentColour,
...
}: {
services.avizo = { services.avizo = {
enable = true; enable = true;
settings.default = with config.lib.stylix.colors; let settings.default = with config.lib.stylix;
with colors; let
opacity = kind: (toString config.stylix.opacity.${kind}); opacity = kind: (toString config.stylix.opacity.${kind});
in { in {
background = "rgba(${base00-rgb-r}, ${base00-rgb-g}, ${base00-rgb-b}, ${opacity "popups"})"; background = "rgba(${base00-rgb-r}, ${base00-rgb-g}, ${base00-rgb-b}, ${opacity "popups"})";
bar-bg-color = "rgba(${base00-rgb-r}, ${base00-rgb-g}, ${base00-rgb-b}, ${opacity "popups"})"; bar-bg-color = "rgba(${base00-rgb-r}, ${base00-rgb-g}, ${base00-rgb-b}, ${opacity "popups"})";
bar-fg-color = "rgba(${base05-rgb-r}, ${base05-rgb-g}, ${base05-rgb-b}, ${opacity "desktop"})"; bar-fg-color = "rgba(${base05-rgb-r}, ${base05-rgb-g}, ${base05-rgb-b}, ${opacity "desktop"})";
border-color = "rgba(${base0E-rgb-r}, ${base0E-rgb-g}, ${base0E-rgb-b}, ${opacity "desktop"})"; border-color = "rgba(${colors."${accentColour}-rgb-r"}, ${colors."${accentColour}-rgb-g"}, ${colors."${accentColour}-rgb-b"}, ${opacity "desktop"})";
image-opacity = opacity "desktop"; image-opacity = opacity "desktop";
}; };
}; };

View file

@ -2,6 +2,7 @@
config, config,
lib, lib,
pkgs, pkgs,
accentColour,
... ...
}: { }: {
stylix.targets.xresources.enable = true; stylix.targets.xresources.enable = true;
@ -123,8 +124,9 @@
smart_resizing = false; smart_resizing = false;
drop_at_cursor = true; drop_at_cursor = true;
}; };
general = with config.lib.stylix.colors; { general = with config.lib.stylix;
"col.active_border" = "rgb(${magenta})"; with colors; {
"col.active_border" = "rgb(${colors.${accentColour}})";
"col.inactive_border" = "rgb(${base03})"; "col.inactive_border" = "rgb(${base03})";
gaps_in = 5; gaps_in = 5;
gaps_out = 10; gaps_out = 10;

View file

@ -1,6 +1,7 @@
{ {
config, config,
pkgs, pkgs,
accentColour,
... ...
}: { }: {
programs.rofi = { programs.rofi = {
@ -38,7 +39,7 @@
bg2 = mkLiteral "rgba (${base01-rgb-r}, ${base01-rgb-g}, ${base01-rgb-b}, 80%)"; bg2 = mkLiteral "rgba (${base01-rgb-r}, ${base01-rgb-g}, ${base01-rgb-b}, 80%)";
fg = mkLiteral withHashtag.base05; fg = mkLiteral withHashtag.base05;
fg2 = mkLiteral withHashtag.base04; fg2 = mkLiteral withHashtag.base04;
border = mkLiteral withHashtag.magenta; border = mkLiteral withHashtag.${accentColour};
blue = mkLiteral withHashtag.blue; blue = mkLiteral withHashtag.blue;
in { in {
"*" = { "*" = {

View file

@ -1,4 +1,8 @@
{config, ...}: { {
config,
accentColour,
...
}: {
xdg.configFile."swaync/style.css".text = with config.lib.stylix.colors; '' xdg.configFile."swaync/style.css".text = with config.lib.stylix.colors; ''
* { * {
all: unset; all: unset;
@ -9,7 +13,7 @@
.floating-notifications.background .notification-row .notification-background { .floating-notifications.background .notification-row .notification-background {
border-radius: 5px; border-radius: 5px;
border: 1px solid ${withHashtag.magenta}; border: 1px solid ${withHashtag.${accentColour}};
margin: 18px; margin: 18px;
background-color: rgba(${base00-rgb-r}, ${base00-rgb-g}, ${base00-rgb-b}, 0.5); background-color: rgba(${base00-rgb-r}, ${base00-rgb-g}, ${base00-rgb-b}, 0.5);
color: ${withHashtag.base05}; color: ${withHashtag.base05};
@ -132,7 +136,7 @@
.control-center { .control-center {
border-radius: 5px; border-radius: 5px;
border: 1px solid ${withHashtag.magenta}; border: 1px solid ${withHashtag.${accentColour}};
margin: 18px; margin: 18px;
background-color: rgba(${base00-rgb-r}, ${base00-rgb-g}, ${base00-rgb-b}, 0.5); background-color: rgba(${base00-rgb-r}, ${base00-rgb-g}, ${base00-rgb-b}, 0.5);
color: ${withHashtag.base05}; color: ${withHashtag.base05};
@ -341,7 +345,7 @@
.widget-dnd > switch slider { .widget-dnd > switch slider {
background: ${withHashtag.base01}; background: ${withHashtag.base01};
border-radius: 8px; border-radius: 8px;
border: 1px solid ${withHashtag.magenta}; border: 1px solid ${withHashtag.${accentColour}};
} }
''; '';