From 9b9912077e11478460c0d919a0101ace8966f44a Mon Sep 17 00:00:00 2001 From: traxys Date: Wed, 13 Mar 2024 17:31:46 +0100 Subject: [PATCH] plugins/alpha: Allow `terminal` to not set `val` (#1261) Fixes #1140 --- plugins/utils/alpha.nix | 13 ++++++------- tests/test-sources/plugins/utils/alpha.nix | 17 +++++++++++++++++ 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/plugins/utils/alpha.nix b/plugins/utils/alpha.nix index d425581f..b180c6bb 100644 --- a/plugins/utils/alpha.nix +++ b/plugins/utils/alpha.nix @@ -22,9 +22,10 @@ with lib; let description = "Type of section"; }; - val = mkOption { - type = with helpers.nixvimTypes; - oneOf [ + val = + helpers.mkNullOrOption + (with helpers.nixvimTypes; + nullOr (oneOf [ # "button", "text" str # "padding" @@ -36,10 +37,8 @@ with lib; let # "group" (attrsOf anything) )) - ]; - default = null; - description = "Value for section"; - }; + ])) + "Value for section"; opts = mkOption { type = with types; attrsOf anything; diff --git a/tests/test-sources/plugins/utils/alpha.nix b/tests/test-sources/plugins/utils/alpha.nix index ef5c5330..77534a43 100644 --- a/tests/test-sources/plugins/utils/alpha.nix +++ b/tests/test-sources/plugins/utils/alpha.nix @@ -13,6 +13,23 @@ }; }; + terminal = { + plugins.alpha = { + enable = true; + layout = [ + { + type = "terminal"; + command = "thisisfine"; + width = 46; + height = 25; + opts = { + redraw = true; + }; + } + ]; + }; + }; + custom-layout = { plugins.alpha = { enable = true;