From d45763f7e26259b801b8adff4ba75ffd3fbfabe2 Mon Sep 17 00:00:00 2001 From: Ching Pei Yang Date: Fri, 28 Mar 2025 12:16:07 +0100 Subject: [PATCH] language/typst: migrate to conform/nvim-lint --- modules/plugins/languages/typst.nix | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/modules/plugins/languages/typst.nix b/modules/plugins/languages/typst.nix index 24097e2c..8c65ae2c 100644 --- a/modules/plugins/languages/typst.nix +++ b/modules/plugins/languages/typst.nix @@ -9,7 +9,6 @@ inherit (lib.lists) isList; inherit (lib.types) nullOr enum either attrsOf listOf package str; inherit (lib.attrsets) attrNames; - inherit (lib.generators) mkLuaInline; inherit (lib.meta) getExe; inherit (lib.nvim.lua) expToLua toLuaObject; inherit (lib.nvim.types) mkGrammarOption mkPluginSetupOption; @@ -61,26 +60,10 @@ formats = { typstfmt = { package = pkgs.typstfmt; - nullConfig = '' - table.insert( - ls_sources, - null_ls.builtins.formatting.typstfmt.with({ - command = "${cfg.format.package}/bin/typstfmt", - }) - ) - ''; }; # https://github.com/Enter-tainer/typstyle typstyle = { package = pkgs.typstyle; - nullConfig = '' - table.insert( - ls_sources, - null_ls.builtins.formatting.typstfmt.with({ - command = "${cfg.format.package}/bin/typstyle", - }) - ) - ''; }; }; in { @@ -176,8 +159,13 @@ in { }) (mkIf cfg.format.enable { - vim.lsp.null-ls.enable = true; - vim.lsp.null-ls.sources.typst-format = formats.${cfg.format.type}.nullConfig; + vim.formatter.conform-nvim = { + enable = true; + setupOpts.formatters_by_ft.typst = [cfg.format.type]; + setupOpts.formatters.${cfg.format.type} = { + command = getExe cfg.format.package; + }; + }; }) (mkIf cfg.lsp.enable {