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; + }; + }; }) ]); }