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:
parent
a214b330e5
commit
581fa67c81
5 changed files with 7 additions and 7 deletions
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue