mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-04-01 10:41:52 +00:00
language/nim: migrate to conform/nvim-lint
This commit is contained in:
parent
ab5dbb263e
commit
e0bcd93bea
1 changed files with 9 additions and 10 deletions
|
@ -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;
|
||||
|
@ -38,14 +39,9 @@
|
|||
formats = {
|
||||
nimpretty = {
|
||||
package = pkgs.nim;
|
||||
nullConfig = ''
|
||||
table.insert(
|
||||
ls_sources,
|
||||
null_ls.builtins.formatting.nimpretty.with({
|
||||
command = "${pkgs.nim}/bin/nimpretty",
|
||||
})
|
||||
)
|
||||
'';
|
||||
config = {
|
||||
command = "${cfg.format.package}/bin/nimpretty";
|
||||
};
|
||||
};
|
||||
};
|
||||
in {
|
||||
|
@ -110,8 +106,11 @@ in {
|
|||
})
|
||||
|
||||
(mkIf cfg.format.enable {
|
||||
vim.lsp.null-ls.enable = true;
|
||||
vim.lsp.null-ls.sources.nim-format = formats.${cfg.format.type}.nullConfig;
|
||||
vim.formatter.conform-nvim = {
|
||||
enable = true;
|
||||
setupOpts.formatters_by_ft.nim = [cfg.format.type];
|
||||
setupOpts.formatters.${cfg.format.type} = formats.${cfg.format.type}.config;
|
||||
};
|
||||
})
|
||||
]);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue