From e95f8e9ce4c126e323bd4e82c3399d43c92185cd Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Fri, 26 Apr 2024 10:47:59 +0200 Subject: [PATCH] plugins/texpresso: init --- plugins/default.nix | 1 + plugins/languages/texpresso.nix | 33 +++++++++++++++++++ .../plugins/languages/texpresso.nix | 6 ++++ 3 files changed, 40 insertions(+) create mode 100644 plugins/languages/texpresso.nix create mode 100644 tests/test-sources/plugins/languages/texpresso.nix diff --git a/plugins/default.nix b/plugins/default.nix index 74823b96..20815866 100644 --- a/plugins/default.nix +++ b/plugins/default.nix @@ -70,6 +70,7 @@ ./languages/rustaceanvim.nix ./languages/sniprun.nix ./languages/tagbar.nix + ./languages/texpresso.nix ./languages/treesitter/hmts.nix ./languages/treesitter/rainbow-delimiters.nix ./languages/treesitter/treesitter-context.nix diff --git a/plugins/languages/texpresso.nix b/plugins/languages/texpresso.nix new file mode 100644 index 00000000..78a0829c --- /dev/null +++ b/plugins/languages/texpresso.nix @@ -0,0 +1,33 @@ +{ + lib, + helpers, + config, + pkgs, + ... +}: +with lib; +# This plugin has no configuration, so we use `mkVimPlugin` without the `globalPrefix` argument to +# avoid the creation of the `settings` option. + helpers.vim-plugin.mkVimPlugin config { + name = "texpresso"; + originalName = "texpresso.vim"; + defaultPackage = pkgs.vimPlugins.texpresso-vim; + + maintainers = [maintainers.nickhu]; + + extraOptions = { + texpressoPackage = mkOption { + type = with types; nullOr package; + default = pkgs.texpresso; + example = null; + description = '' + The `texpresso` package to use. + Set to `null` to not install any package. + ''; + }; + }; + + extraConfig = cfg: { + extraPackages = [cfg.texpressoPackage]; + }; + } diff --git a/tests/test-sources/plugins/languages/texpresso.nix b/tests/test-sources/plugins/languages/texpresso.nix new file mode 100644 index 00000000..f054134d --- /dev/null +++ b/tests/test-sources/plugins/languages/texpresso.nix @@ -0,0 +1,6 @@ +{pkgs, ...}: { + empty = { + # texpresso is broken on darwin + plugins.texpresso.enable = !pkgs.stdenv.isDarwin; + }; +}