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

View file

@ -1,13 +1,18 @@
{config, ...}: {
{
config,
accentColour,
...
}: {
services.avizo = {
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});
in {
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-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";
};
};

View file

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

View file

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

View file

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