From afe7559c8ec88013d14990e78c8ebbc62423adfa Mon Sep 17 00:00:00 2001 From: Joshua Manchester Date: Thu, 24 Jul 2025 15:57:06 +0100 Subject: [PATCH] utility/undotree: use enable option --- modules/plugins/utility/undotree/config.nix | 28 ++++++++++++++------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/modules/plugins/utility/undotree/config.nix b/modules/plugins/utility/undotree/config.nix index d954d49f..06343e6a 100644 --- a/modules/plugins/utility/undotree/config.nix +++ b/modules/plugins/utility/undotree/config.nix @@ -1,12 +1,22 @@ { - vim.lazy.plugins.undotree = { - package = "undotree"; - cmd = [ - "UndotreeToggle" - "UndotreeShow" - "UndotreeHide" - "UndotreePersistUndo" - "UndotreeFocus" - ]; + lib, + config, + ... +}: let + inherit (lib.modules) mkIf; + + cfg = config.vim.utility.undotree; +in { + config = mkIf cfg.enable { + vim.lazy.plugins.undotree = { + package = "undotree"; + cmd = [ + "UndotreeToggle" + "UndotreeShow" + "UndotreeHide" + "UndotreePersistUndo" + "UndotreeFocus" + ]; + }; }; }