stylix: guard entire overlay declarations (#1088)

Closes: https://github.com/danth/stylix/issues/865
Link: https://github.com/danth/stylix/pull/1088

Tested-by: https://github.com/PedroHLC
Reviewed-by: NAHO <90870942+trueNAHO@users.noreply.github.com>
This commit is contained in:
awwpotato 2025-04-04 07:10:55 -07:00 committed by GitHub
parent a214b330e5
commit 581fa67c81
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 7 additions and 7 deletions

View file

@ -87,7 +87,7 @@ taking two arguments and returning an attrset:
}:
{
options.stylix.targets.«name».enable =
config.lib.stylix.mkEnableOverlay "«human readable name»";
config.lib.stylix.mkEnableTarget "«human readable name»" true;
overlay =
final: prev:

View file

@ -7,7 +7,7 @@ let
in
{
options.stylix.targets.gnome-text-editor.enable =
config.lib.stylix.mkEnableOverlay "GNOME Text Editor";
config.lib.stylix.mkEnableTarget "GNOME Text Editor" true;
overlay =
_: prev:

View file

@ -6,7 +6,7 @@
}:
{
options.stylix.targets.nixos-icons.enable =
config.lib.stylix.mkEnableOverlay "the NixOS logo";
config.lib.stylix.mkEnableTarget "the NixOS logo" true;
overlay =
_: super:

View file

@ -20,7 +20,9 @@ inputs:
in
{
options = attrs.options or { };
config.nixpkgs.overlays = [ attrs.overlay ];
config.nixpkgs.overlays = lib.mkIf config.stylix.overlays.enable [
attrs.overlay
];
}
) (import ./autoload.nix { inherit lib inputs; } "overlay");
}

View file

@ -35,7 +35,7 @@
let
cfg = config.stylix;
in
rec {
{
mkEnableTarget =
humanName: autoEnable:
lib.mkEnableOption "theming for ${humanName}"
@ -57,7 +57,5 @@
// lib.optionalAttrs autoEnable {
defaultText = lib.literalMD "`stylix.image != null`";
};
mkEnableOverlay =
humanName: mkEnableTarget humanName config.stylix.overlays.enable;
};
}