Wallpaper: Add support for predefined styles.
This commit is contained in:
parent
b783cf0d86
commit
3565544f46
|
@ -1,9 +1,13 @@
|
|||
# Download the wallpaper here.
|
||||
{ pkgs, lib, ... }:
|
||||
let
|
||||
url = "https://i.imgur.com/03KK4WG.jpeg";
|
||||
sha256 = "sha256-lCaYGl+Y1iLtslDqAu/HTqpyWgSOnR+bMI0fKSwjW6w=";
|
||||
url = "https://i.imgur.com/AKsJ3Rl.jpeg";
|
||||
sha256 = "sha256-DIgboGiIGJb2bKi7zqb17m7jctEgWyrSI/mSypeV7dQ=";
|
||||
forceContrastText = false;
|
||||
|
||||
# SEE: https://github.com/tinted-theming/schemes
|
||||
# Warm: "${pkgs.base16-schemes}/share/themes/gruvbox-dark-hard.yaml"
|
||||
style = null;
|
||||
in
|
||||
{
|
||||
options.module.wallpaper = {
|
||||
|
@ -15,5 +19,9 @@ in
|
|||
default = pkgs.fetchurl { inherit url sha256; };
|
||||
type = lib.types.path;
|
||||
};
|
||||
style = lib.mkOption {
|
||||
default = style;
|
||||
type = with lib.types; nullOr (oneOf [ path lines attrs ]);
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,41 +1,46 @@
|
|||
{ config, ... }:
|
||||
{ config, lib, ... }:
|
||||
let
|
||||
style = config.module.style;
|
||||
wallpaper = config.module.wallpaper;
|
||||
in
|
||||
{
|
||||
stylix = {
|
||||
inherit (config.module.style) cursor;
|
||||
enable = true;
|
||||
autoEnable = true;
|
||||
image = wallpaper.path;
|
||||
polarity = "dark";
|
||||
fonts = with style.font; {
|
||||
inherit
|
||||
emoji
|
||||
monospace
|
||||
sansSerif
|
||||
serif
|
||||
;
|
||||
sizes = with size; {
|
||||
inherit desktop terminal;
|
||||
applications = application;
|
||||
popups = popup;
|
||||
config = lib.mkMerge [
|
||||
{
|
||||
stylix = {
|
||||
inherit (config.module.style) cursor;
|
||||
enable = true;
|
||||
autoEnable = true;
|
||||
image = wallpaper.path;
|
||||
polarity = "dark";
|
||||
fonts = with style.font; {
|
||||
inherit
|
||||
emoji
|
||||
monospace
|
||||
sansSerif
|
||||
serif
|
||||
;
|
||||
sizes = with size; {
|
||||
inherit desktop terminal;
|
||||
applications = application;
|
||||
popups = popup;
|
||||
};
|
||||
};
|
||||
opacity = with style.opacity; {
|
||||
inherit desktop terminal;
|
||||
applications = application;
|
||||
popups = popups;
|
||||
};
|
||||
};
|
||||
};
|
||||
opacity = with style.opacity; {
|
||||
inherit desktop terminal;
|
||||
applications = application;
|
||||
popups = popups;
|
||||
};
|
||||
override =
|
||||
if wallpaper.forceContrastText then
|
||||
{
|
||||
base04 = "000000";
|
||||
base05 = "ffffff";
|
||||
base06 = "ffffff";
|
||||
}
|
||||
else
|
||||
{ };
|
||||
};
|
||||
}
|
||||
|
||||
(lib.mkIf wallpaper.forceContrastText {
|
||||
stylix.override = {
|
||||
base04 = lib.mkForce "000000";
|
||||
base05 = lib.mkForce "ffffff";
|
||||
base06 = lib.mkForce "ffffff";
|
||||
};
|
||||
})
|
||||
|
||||
(lib.mkIf (wallpaper.style != null) { stylix.base16Scheme = wallpaper.style; })
|
||||
];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue