From 459e97dab7dc3c5194c68d5dc73ea81bf798d98d Mon Sep 17 00:00:00 2001 From: Ching Pei Yang Date: Thu, 27 Mar 2025 19:52:28 +0100 Subject: [PATCH] language/css: migrate to conform/nvim-lint --- modules/plugins/languages/css.nix | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/modules/plugins/languages/css.nix b/modules/plugins/languages/css.nix index 8330a41a..d103f241 100644 --- a/modules/plugins/languages/css.nix +++ b/modules/plugins/languages/css.nix @@ -6,6 +6,7 @@ }: let inherit (builtins) attrNames; inherit (lib.options) mkEnableOption mkOption; + inherit (lib.meta) getExe; inherit (lib.modules) mkIf mkMerge; inherit (lib.lists) isList; inherit (lib.types) enum either listOf package str; @@ -42,14 +43,6 @@ formats = { prettier = { package = pkgs.nodePackages.prettier; - nullConfig = '' - table.insert( - ls_sources, - null_ls.builtins.formatting.prettier.with({ - command = "${cfg.format.package}/bin/prettier", - }) - ) - ''; }; prettierd = { @@ -132,8 +125,13 @@ in { }) (mkIf cfg.format.enable { - vim.lsp.null-ls.enable = true; - vim.lsp.null-ls.sources.css-format = formats.${cfg.format.type}.nullConfig; + vim.formatter.conform-nvim = { + enable = true; + setupOpts.formatters_by_ft.css = [cfg.format.type]; + setupOpts.formatters.${cfg.format.type} = { + command = getExe cfg.format.package; + }; + }; }) ]); }