stylix: add accent color

I spent an hour just to add one f*ing option
This commit is contained in:
2026-06-08 03:24:54 +03:00
parent c8b5900985
commit 98434b79cf
9 changed files with 56 additions and 14 deletions
+2 -6
View File
@@ -1,15 +1,11 @@
{ stdenv, lib, config, colors, username, ... }:
{ stdenv, colors, accent ? colors.base0B, ... }:
stdenv.mkDerivation {
name = "AGS theme";
src = ./ags;
dontUnpack = true;
patchPhase = let
accent = if username == "chest"
then colors.base0E
else colors.base0B;
in ''
patchPhase = ''
echo \$bg: \#${colors.base00}\; > colors.scss
echo \$surface0: \#${colors.base02}\; >> colors.scss
echo \$fg: \#${colors.base05}\; >> colors.scss
+40
View File
@@ -0,0 +1,40 @@
{ config, lib, ... }: let
inherit (lib) mkOption types;
base16Names = [
"base00"
"base01"
"base02"
"base03"
"base04"
"base05"
"base06"
"base07"
"base08"
"base09"
"base0A"
"base0B"
"base0C"
"base0D"
"base0E"
"base0F"
];
in {
options.stylix.accent = mkOption {
type = types.enum base16Names;
default = "base0B";
description = ''
Base16 colour used as the user accent.
Use it as:
config.lib.stylix.colors.${config.stylix.accent}
config.lib.stylix.colors.withHashtag.${config.stylix.accent}
This module deliberately does not extend config.lib.stylix.colors: Stylix
exports that value as a generated base16 attrset/functor, and replacing or
partially extending it can break Stylix targets which expect metadata such
as `scheme` to be present.
'';
};
}