stylix: prevent partially declared cursor (#1080)
Closes: https://github.com/danth/stylix/issues/1064 Link: https://github.com/danth/stylix/pull/1080 Reviewed-by: awwpotato <153149335+awwpotato@users.noreply.github.com> Reviewed-by: NAHO <90870942+trueNAHO@users.noreply.github.com>
This commit is contained in:
parent
54721996d6
commit
1832ffa9a2
1 changed files with 26 additions and 5 deletions
|
|
@ -1,26 +1,47 @@
|
|||
{ lib, ... }:
|
||||
{ lib, config, ... }:
|
||||
|
||||
{
|
||||
options.stylix.cursor = lib.mkOption {
|
||||
description = "Attributes defining the systemwide cursor.";
|
||||
description = ''
|
||||
Attributes defining the systemwide cursor. Set either all or none of
|
||||
these attributes.
|
||||
'';
|
||||
type = lib.types.nullOr (
|
||||
lib.types.submodule {
|
||||
options = {
|
||||
name = lib.mkOption {
|
||||
description = "The cursor name within the package.";
|
||||
type = lib.types.str;
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
default = null;
|
||||
};
|
||||
package = lib.mkOption {
|
||||
description = "Package providing the cursor theme.";
|
||||
type = lib.types.package;
|
||||
type = lib.types.nullOr lib.types.package;
|
||||
default = null;
|
||||
};
|
||||
size = lib.mkOption {
|
||||
description = "The cursor size.";
|
||||
type = lib.types.int;
|
||||
type = lib.types.nullOr lib.types.int;
|
||||
default = null;
|
||||
};
|
||||
};
|
||||
}
|
||||
);
|
||||
default = null;
|
||||
};
|
||||
config.assertions =
|
||||
let
|
||||
inherit (config.stylix) cursor;
|
||||
in
|
||||
[
|
||||
{
|
||||
assertion =
|
||||
cursor == null
|
||||
|| cursor.name != null && cursor.package != null && cursor.size != null;
|
||||
message = ''
|
||||
stylix: `stylix.cursor` is only partially defined. Set either none or
|
||||
all of the `stylix.cursor` options.
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue