stylix: add 'stylix.enable' option (#244)

Add a 'stylix.enable' option to enable or disable all Stylix modules in
order to resolve issues similar to [2].

To align with the default 'lib.mkEnableOption' [1] behavior,
'stylix.enable' defaults to 'false'.

BREAKING CHANGE: Stylix is disabled by default. To enable it, use:

    stylix.enable = true;

[1]: https://github.com/NixOS/nixpkgs/blob/23.11/lib/options.nix#L91-L105
[2]: https://github.com/danth/stylix/issues/216

Co-authored-by: Daniel Thwaites <danthwaites30@btinternet.com>
Co-authored-by: Jalil David Salamé Messina <jalil.salame@gmail.com>
Co-authored-by: NAHO <90870942+trueNAHO@users.noreply.github.com>
This commit is contained in:
Jalil David Salamé Messina 2024-06-10 11:52:47 +02:00 committed by GitHub
parent ca3247ed8c
commit 7682713f6a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
67 changed files with 196 additions and 116 deletions

View file

@ -3,9 +3,9 @@
let
colors = config.lib.stylix.colors.withHashtag;
in {
options.stylix.targets.btop.enable = config.lib.stylix.mkEnableTarget "btop" config.programs.btop.enable;
options.stylix.targets.btop.enable = config.lib.stylix.mkEnableTarget "btop" true;
config = lib.mkIf config.stylix.targets.btop.enable {
config = lib.mkIf (config.stylix.enable && config.stylix.targets.btop.enable && config.programs.btop.enable) {
programs.btop.settings = {
color_theme = "stylix";