diff --git a/plugins/by-name/typst-vim/default.nix b/plugins/by-name/typst-vim/default.nix index 7c9926a5..679f3016 100644 --- a/plugins/by-name/typst-vim/default.nix +++ b/plugins/by-name/typst-vim/default.nix @@ -10,9 +10,6 @@ helpers.vim-plugin.mkVimPlugin { originalName = "typst.vim"; globalPrefix = "typst_"; - # Add the typst compiler to nixvim packages - extraPackages = [ pkgs.typst ]; - maintainers = [ maintainers.GaetanLepage ]; # TODO introduced 2024-02-20: remove 2024-04-20 @@ -25,6 +22,11 @@ helpers.vim-plugin.mkVimPlugin { ]; extraOptions = { + # Add the typst compiler to nixvim packages + typstPackage = lib.mkPackageOption pkgs "typst" { + nullable = true; + }; + keymaps = { silent = mkOption { type = types.bool; @@ -37,6 +39,8 @@ helpers.vim-plugin.mkVimPlugin { }; extraConfig = cfg: { + extraPackages = [ cfg.typstPackage ]; + keymaps = with cfg.keymaps; helpers.keymaps.mkKeymaps diff --git a/tests/test-sources/plugins/by-name/typst-vim/default.nix b/tests/test-sources/plugins/by-name/typst-vim/default.nix index 581ace50..2e88f465 100644 --- a/tests/test-sources/plugins/by-name/typst-vim/default.nix +++ b/tests/test-sources/plugins/by-name/typst-vim/default.nix @@ -20,4 +20,11 @@ }; }; }; + + no-packages = { + plugins.typst-vim = { + enable = true; + typstPackage = null; + }; + }; }