Use native toml format instead of handrolling
This commit is contained in:
parent
23c2436ab6
commit
cc7d62745c
|
@ -193,29 +193,27 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable
|
||||||
home.packages = [ cfg.package ];
|
{
|
||||||
|
home.packages = [ cfg.package ];
|
||||||
|
|
||||||
# Configurations
|
# Configurations
|
||||||
xdg.configFile."kak-lsp/kak-lsp.toml" = {
|
xdg.configFile."kak-lsp/kak-lsp.toml" =
|
||||||
source = pkgs.runCommand "config.toml"
|
let
|
||||||
|
toml = pkgs.formats.toml { };
|
||||||
|
stripNulls = lib.filterAttrsRecursive (n: v: v != null);
|
||||||
|
in
|
||||||
{
|
{
|
||||||
buildInputs = [ pkgs.yj ];
|
source = toml.generate "config.toml"
|
||||||
preferLocalBuild = true;
|
{
|
||||||
} ''
|
|
||||||
yj -jt -i \
|
|
||||||
< ${
|
|
||||||
pkgs.writeText "config.json" (builtins.toJSON {
|
|
||||||
semantic_tokens.faces = cfg.semanticTokens.faces ++ cfg.semanticTokens.additionalFaces;
|
semantic_tokens.faces = cfg.semanticTokens.faces ++ cfg.semanticTokens.additionalFaces;
|
||||||
server.timeout = cfg.serverTimeout;
|
server.timeout = cfg.serverTimeout;
|
||||||
snippet_support = cfg.enableSnippets;
|
snippet_support = cfg.enableSnippets;
|
||||||
verbosity = 255;
|
verbosity = 255;
|
||||||
language_server = lspConfig.language_servers // cfg.languageServers;
|
language_server = stripNulls (lspConfig.language_servers // cfg.languageServers);
|
||||||
language_ids = lspConfig.language_ids // cfg.languageIds;
|
language_ids = lspConfig.language_ids // cfg.languageIds;
|
||||||
})
|
};
|
||||||
} \
|
};
|
||||||
> $out
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue