Merge remote-tracking branch 'upstream/main'

This commit is contained in:
PartyWumpus 2025-09-17 18:51:17 +01:00
commit 31eb99a846
360 changed files with 11321 additions and 6338 deletions

View file

@ -9,7 +9,6 @@
inherit (lib.lists) isList;
inherit (lib.types) nullOr enum either attrsOf listOf package str bool int;
inherit (lib.attrsets) attrNames;
inherit (lib.generators) mkLuaInline;
inherit (lib.meta) getExe;
inherit (lib.nvim.binds) mkMappingOption mkKeymap;
inherit (lib.nvim.lua) expToLua toLuaObject;
@ -62,26 +61,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 {
@ -94,7 +77,7 @@ in {
};
lsp = {
enable = mkEnableOption "Typst LSP support (typst-lsp)" // {default = config.vim.languages.enableLSP;};
enable = mkEnableOption "Typst LSP support (typst-lsp)" // {default = config.vim.lsp.enable;};
server = mkOption {
description = "Typst LSP server to use";
@ -222,8 +205,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 {