From d909dcd13d1c9bcc0765f2dbf8243e423eae9f4e Mon Sep 17 00:00:00 2001 From: Heitor Augusto Date: Sat, 7 Sep 2024 12:23:12 -0300 Subject: [PATCH] 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` --- modules/kwin.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/kwin.nix b/modules/kwin.nix index 2f42df6b..930bc550 100644 --- a/modules/kwin.nix +++ b/modules/kwin.nix @@ -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; }; }; })