From baf216bb0f79866154659e358e48ef7979e231a0 Mon Sep 17 00:00:00 2001 From: Pei Yang Ching Date: Tue, 25 Jun 2024 17:16:49 +0200 Subject: [PATCH] add lazy module skeleton --- modules/modules.nix | 1 + modules/wrapper/lazy/config.nix | 14 ++++++++++++++ modules/wrapper/lazy/default.nix | 6 ++++++ modules/wrapper/lazy/lazy.nix | 15 +++++++++++++++ 4 files changed, 36 insertions(+) create mode 100644 modules/wrapper/lazy/config.nix create mode 100644 modules/wrapper/lazy/default.nix create mode 100644 modules/wrapper/lazy/lazy.nix diff --git a/modules/modules.nix b/modules/modules.nix index a00cea6..a995754 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -50,6 +50,7 @@ wrapper = map (p: ./wrapper + "/${p}") [ "build" "rc" + "lazy" "warnings" ]; diff --git a/modules/wrapper/lazy/config.nix b/modules/wrapper/lazy/config.nix new file mode 100644 index 0000000..53df6ae --- /dev/null +++ b/modules/wrapper/lazy/config.nix @@ -0,0 +1,14 @@ +{ + lib, + config, + ... +}: let + inherit (lib.modules) mkIf; + cfg = config.vim.lazy; +in { + config.vim = mkIf cfg.enable { + startPlugins = ["lz-n"]; + + # optPlugins = + }; +} diff --git a/modules/wrapper/lazy/default.nix b/modules/wrapper/lazy/default.nix new file mode 100644 index 0000000..fa40127 --- /dev/null +++ b/modules/wrapper/lazy/default.nix @@ -0,0 +1,6 @@ +_: { + imports = [ + ./lazy.nix + ./config.nix + ]; +} diff --git a/modules/wrapper/lazy/lazy.nix b/modules/wrapper/lazy/lazy.nix new file mode 100644 index 0000000..0b11ab1 --- /dev/null +++ b/modules/wrapper/lazy/lazy.nix @@ -0,0 +1,15 @@ +{lib, ...}: let + inherit (lib.options) mkOption mkEnableOption; + inherit (lib.types) enum; +in { + options.vim.lazy = { + enable = mkEnableOption "plugin lazy-loading" // {default = true;}; + loader = mkOption { + description = "Lazy loader to use"; + type = enum ["lz.n"]; + default = "lz.n"; + }; + + # plugins = mkOption {}; + }; +}