Add proper support for custom schemes.

This commit is contained in:
Dmitry Voronin 2024-12-30 05:14:17 +03:00
parent 7662b95e0b
commit 9bc47a6b69
Signed by: voronind
SSH key fingerprint: SHA256:3kBb4iV2ahufEBNq+vFbUe4QYfHt98DHQjN7QaptY9k
2 changed files with 29 additions and 3 deletions

View file

@ -4,6 +4,20 @@ let
url = "https://i.imgur.com/KkZFMD3.png"; url = "https://i.imgur.com/KkZFMD3.png";
sha256 = "sha256-cTNUeamZTjQDx8gGZkU1mj4kKS3FEE0+EDzFb5bsyZE="; sha256 = "sha256-cTNUeamZTjQDx8gGZkU1mj4kKS3FEE0+EDzFb5bsyZE=";
forceContrastText = false; forceContrastText = false;
# SEE: https://github.com/tinted-theming/schemes
# Blue: "${pkgs.base16-schemes}/share/themes/moonlight.yaml"
# Brown: "${pkgs.base16-schemes}/share/themes/sandcastle.yaml"
# Classy: "${pkgs.base16-schemes}/share/themes/monokai.yaml"
# Cold: "${pkgs.base16-schemes}/share/themes/nord.yaml"
# Cool: "${pkgs.base16-schemes}/share/themes/tokyo-night-dark.yaml"
# Gray: "${pkgs.base16-schemes}/share/themes/nova.yaml"
# Material: "${pkgs.base16-schemes}/share/themes/material.yaml"
# Purple: "${pkgs.base16-schemes}/share/themes/shades-of-purple.yaml"
# Retro: "${pkgs.base16-schemes}/share/themes/mocha.yaml"
# Warm: "${pkgs.base16-schemes}/share/themes/gruvbox-dark-hard.yaml"
# scheme = "${pkgs.base16-schemes}/share/themes/moonlight.yaml";
scheme = null;
in in
{ {
options.module.wallpaper = { options.module.wallpaper = {
@ -15,5 +29,15 @@ in
default = pkgs.fetchurl { inherit url sha256; }; default = pkgs.fetchurl { inherit url sha256; };
type = lib.types.path; type = lib.types.path;
}; };
scheme = lib.mkOption {
default = scheme;
type =
with lib.types;
nullOr (oneOf [
path
lines
attrs
]);
};
}; };
} }

View file

@ -4,7 +4,7 @@ let
wallpaper = config.module.wallpaper; wallpaper = config.module.wallpaper;
in in
{ {
stylix = stylix = lib.mkMerge [
{ {
inherit (config.module.style) cursor; inherit (config.module.style) cursor;
enable = true; enable = true;
@ -30,11 +30,13 @@ in
popups = popup; popups = popup;
}; };
} }
// (lib.optionalAttrs wallpaper.forceContrastText { (lib.mkIf wallpaper.forceContrastText {
override = { override = {
base04 = "000000"; base04 = "000000";
base05 = "ffffff"; base05 = "ffffff";
base06 = "ffffff"; base06 = "ffffff";
}; };
}); })
(lib.mkIf (wallpaper.scheme != null) { base16Scheme = wallpaper.scheme; })
];
} }