feat(typst-lsp): added
This commit is contained in:
20
default.nix
20
default.nix
@@ -74,16 +74,28 @@ in
|
||||
];
|
||||
extraLuaConfig =
|
||||
let
|
||||
paths = {
|
||||
# tries to compute a package set required to make package resolution in lua
|
||||
# via deps["pkg"] work
|
||||
packages = file:
|
||||
let
|
||||
out = builtins.readFile (pkgs.runCommandLocal "extract-deps"
|
||||
{ nativeBuildInputs = [ pkgs.gnused ]; __contentAddressed = true; } ''
|
||||
sed -nr 's/.*(deps\.(.*)_path|deps\["(.*)"\]).*/\2/p' ${file} | uniq > $out
|
||||
'');
|
||||
names = lib.splitString "\n" (lib.traceVal out);
|
||||
in
|
||||
filter (name: name != "") names;
|
||||
paths = (listToAttrs (map (name: { inherit name; value = builtins.getAttr name pkgs; }) (packages "${confDir}/*.lua"))) // {
|
||||
lldb = pkgs.lldb;
|
||||
rust_analyzer = rust-analyzer;
|
||||
typst_lsp = pkgs.typst-lsp;
|
||||
};
|
||||
pathsLua = pkgs.writeTextFile {
|
||||
name = "nvim-deps.lua";
|
||||
text = ''
|
||||
return {
|
||||
${concatStringsSep ",\n " (mapAttrsToList (name: path: ''${name}_path = "${path}"'') paths)}
|
||||
}
|
||||
deps = {}
|
||||
${concatStringsSep "\n " (mapAttrsToList (name: path: ''deps["${name}_path"] = "${path}"'') paths)}
|
||||
return deps
|
||||
'';
|
||||
};
|
||||
confDir = lib.sourceFilesBySuffices ./. [ "lua" "vim" ];
|
||||
|
||||
Reference in New Issue
Block a user