stylix: allow color scheme generation from image
This commit is contained in:
parent
0ae912d980
commit
954e6182e1
1 changed files with 8 additions and 2 deletions
|
|
@ -51,11 +51,13 @@ in
|
||||||
|
|
||||||
options.stylix = {
|
options.stylix = {
|
||||||
scheme = lib.mkOption {
|
scheme = lib.mkOption {
|
||||||
type = types.str;
|
type = types.nullOr types.str;
|
||||||
default = "dracula";
|
default = "dracula";
|
||||||
description = ''
|
description = ''
|
||||||
Base16 color scheme name. Available options are:
|
Base16 color scheme name. Available options are:
|
||||||
${toString validSchemes}
|
${toString validSchemes}
|
||||||
|
|
||||||
|
Set to `null` to generate a color scheme from `stylix.image`
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
@ -66,11 +68,15 @@ in
|
||||||
assertion = builtins.elem cfg.scheme validSchemes;
|
assertion = builtins.elem cfg.scheme validSchemes;
|
||||||
message = "Stylix: Invalid colorscheme '${cfg.scheme}'. Available options: ${toString validSchemes}";
|
message = "Stylix: Invalid colorscheme '${cfg.scheme}'. Available options: ${toString validSchemes}";
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
assertion = (cfg.scheme != null) || (cfg.image != null);
|
||||||
|
message = "Stylix: You need to set stylix.image if stylix.scheme is `null`";
|
||||||
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
stylix = {
|
stylix = {
|
||||||
autoEnable = mkDefault true;
|
autoEnable = mkDefault true;
|
||||||
base16Scheme = scheme;
|
base16Scheme = mkIf (cfg.scheme != null) scheme;
|
||||||
fonts = {
|
fonts = {
|
||||||
monospace = mkDefault {
|
monospace = mkDefault {
|
||||||
package = pkgs.hack-font;
|
package = pkgs.hack-font;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue