treewide: optionalize stylix.image option (#717)

Optionalize the stylix.image option when stylix.base16Scheme is set,
making the following Stylix configurations valid:

    [
      // Now it possible to set 'stylix.image = null', if
      // stylix.base16Scheme is set.
      {
        base16Scheme = /* ... */;
      }

      // This configuration was already possible.
      {
        image = /* ... */;
      }

      // This configuration was already possible.
      {
        base16Scheme = /* ... */;
        image = /* ... */;
      }
    ]

Closes: https://github.com/danth/stylix/issues/200
Closes: https://github.com/danth/stylix/issues/442
Link: https://github.com/danth/stylix/pull/717

Co-authored-by: NAHO <90870942+trueNAHO@users.noreply.github.com>
Reviewed-by: NAHO <90870942+trueNAHO@users.noreply.github.com>
Tested-by: NAHO <90870942+trueNAHO@users.noreply.github.com>
Reviewed-by: Daniel Thwaites <danth@danth.me>
This commit is contained in:
Flameopathic 2025-02-24 09:13:57 -05:00 committed by GitHub
parent f121a142ab
commit c8e4a0d218
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 401 additions and 290 deletions

View file

@ -4,16 +4,21 @@
lib,
...
}:
let
cfg = config.stylix.targets.feh;
in
{
options.stylix.targets.feh.enable =
config.lib.stylix.mkEnableTarget "the desktop background using Feh" true;
options.stylix.targets.feh = {
enable = config.lib.stylix.mkEnableTarget "the desktop background using Feh" (
config.stylix.image != null
);
};
config.xsession.initExtra =
lib.mkIf
(
config.stylix.enable
&& config.stylix.targets.feh.enable
&& cfg.enable
&& (
with config.xsession.windowManager;
bspwm.enable

View file

@ -4,16 +4,21 @@
lib,
...
}:
let
cfg = config.stylix.targets.feh;
in
{
options.stylix.targets.feh.enable =
config.lib.stylix.mkEnableTarget "the desktop background using Feh" true;
options.stylix.targets.feh = {
enable = config.lib.stylix.mkEnableTarget "the desktop background using Feh" (
config.stylix.image != null
);
};
config.services.xserver.displayManager.sessionCommands =
lib.mkIf
(
config.stylix.enable
&& config.stylix.targets.feh.enable
&& cfg.enable
&& (with config.services.xserver.windowManager; xmonad.enable || i3.enable)
)
(