Refactor tiling layout type (#354)

- Move conversion to JSON to apply function of tiles
- Made options of tiling layout not optional
- Added example for `layout.id`
This commit is contained in:
Heitor Augusto 2024-09-07 12:23:12 -03:00 committed by GitHub
parent 88686928e4
commit d909dcd13d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -82,13 +82,12 @@ let
tilingLayoutType = types.submodule {
options = {
id = mkOption {
type = with types; nullOr str;
default = null;
type = types.str;
description = "The id of the layout.";
example = "cf5c25c2-4217-4193-add6-b5971cb543f2";
};
tiles = mkOption {
type = with types; nullOr (attrsOf anything);
default = null;
type = with types; attrsOf anything;
example = {
layoutDirection = "horizontal";
tiles = [
@ -109,6 +108,7 @@ let
}
];
};
apply = builtins.toJSON;
};
};
};
@ -678,7 +678,7 @@ in
"Tiling/${cfg.kwin.tiling.layout.id}" = {
tiles = {
escapeValue = false;
value = builtins.toJSON cfg.kwin.tiling.layout.tiles;
value = cfg.kwin.tiling.layout.tiles;
};
};
})