Add ltex-ls to latex

This commit is contained in:
Natsu Kagami 2024-07-03 19:43:15 +02:00
parent 27e1fcf99b
commit c397c143e1
Signed by: nki
GPG key ID: 55A032EB38B49ADB
3 changed files with 31 additions and 16 deletions

View file

@ -761,11 +761,11 @@
"kak-lsp": {
"flake": false,
"locked": {
"lastModified": 1716147388,
"narHash": "sha256-v23rgAQZkIdCXZTyyvGL9GqMZNbiDHziQIdMNctNvKE=",
"lastModified": 1719761259,
"narHash": "sha256-2cnjweEU/NgQffF2gav9b6EIXmV9TcSd7214FzW7ekY=",
"owner": "kakoune-lsp",
"repo": "kakoune-lsp",
"rev": "384cc52ed75eaeed95503fa2f92f635968012847",
"rev": "484b19c2e373988ee5ab9afc54ecd6383b8da9bc",
"type": "github"
},
"original": {
@ -777,11 +777,11 @@
"kakoune": {
"flake": false,
"locked": {
"lastModified": 1716007386,
"narHash": "sha256-1nYSVbvQ4tz1r8p7zCD6w/79haqpelb15qva9r3Fwew=",
"lastModified": 1719405481,
"narHash": "sha256-IkPZSkEJQixpylRGqLO330oZ50CS0Aq0JqMvU5B+Abo=",
"owner": "mawww",
"repo": "kakoune",
"rev": "1bd50261c8c1c867f76e79f626dc571981f15bfd",
"rev": "80fcfebca8c62ace6cf2af9487784486af07d2d5",
"type": "github"
},
"original": {

View file

@ -1,13 +1,6 @@
{ config, pkgs, lib, ... }:
{ pkgs, lib, ... }:
let
kak-lsp = pkgs.libs.crane.buildPackage {
src = pkgs.sources.kak-lsp;
buildInputs = (with pkgs;
lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ Security SystemConfiguration CoreServices ])
) ++ (with pkgs; [ libiconv ]);
};
kak-lsp-frontend = { pkgs, lib, ... }:
let
langserver = name: {
@ -59,10 +52,20 @@ let
];
};
ltexLsp = { pkgs, lib, ... }: {
programs.kak-lsp.languageServers.ltex-ls = {
command = "ltex-ls";
args = [ "--log-file=/tmp" ];
filetypes = [ "latex" "typst" ];
roots = [ "main.tex" "main.typ" ".git" ];
};
home.packages = [ pkgs.ltex-ls ];
};
in
{
imports = [ ../modules/programs/my-kakoune ./kaktex.nix kak-lsp-frontend ];
imports = [ ../modules/programs/my-kakoune ./kaktex.nix kak-lsp-frontend ltexLsp ];
home.packages = with pkgs; [
# ctags for peneira
@ -79,7 +82,6 @@ in
programs.my-kakoune.enable = true;
programs.my-kakoune.enable-fish-session = true;
programs.kak-lsp.enable = true;
programs.kak-lsp.package = kak-lsp;
programs.kak-lsp.semanticTokens.additionalFaces = [
# Typst
{ face = "header"; token = "heading"; }

View file

@ -94,6 +94,19 @@ let
overlay-packages = final: prev: {
kak-tree-sitter = final.callPackage ./packages/common/kak-tree-sitter.nix { rustPlatform = final.unstable.rustPlatform; };
kak-lsp =
let
src = inputs.kak-lsp;
cargoArtifacts = final.libs.crane.buildDepsOnly { inherit src; };
in
final.libs.crane.buildPackage {
inherit src cargoArtifacts;
buildInputs = (with final;
lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ Security SystemConfiguration CoreServices ])
) ++ (with final; [ libiconv ]);
};
};
overlay-aarch64-linux = final: prev: