about summary refs log tree commit diff
path: root/pkgs/development/tools/language-servers/typst-lsp/default.nix
blob: 1ec17c194d06cefd8e7d6a2bde3b1cfed6fca0d2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
{ lib
, rustPlatform
, fetchFromGitHub
}:

rustPlatform.buildRustPackage rec {
  pname = "typst-lsp";
  version = "0.7.0";

  src = fetchFromGitHub {
    owner = "nvarner";
    repo = pname;
    rev = "v${version}";
    hash = "sha256-t8ho2dX8ulDQI0FME3xF+Fq9A6xYKsujfcXNkw1k7e4=";
  };

  cargoLock = {
    lockFile = ./Cargo.lock;
    outputHashes = {
      "elsa-1.8.1" = "sha256-/85IriplPxx24TE/CsvjIsve100QUZiVqS0TWgPFRbw=";
      "svg2pdf-0.4.1" = "sha256-WeVP+yhqizpTdRfyoj2AUxFKhGvVJIIiRV0GTXkgLtQ=";
      "typst-0.5.0" = "sha256-obUe9OVQ8M7MORudQGN7zaYjUv4zjeh7XidHHmUibTA=";
    };
  };

  patches = [
    # typst-library tries to access the workspace with include_bytes, which
    # fails when it is vendored as its own separate crate
    # this patch moves the required assets into the crate and fixes the issue
    # see https://github.com/typst/typst/pull/1515
    ./move-typst-assets.patch
  ];

  meta = with lib; {
    description = "A brand-new language server for Typst";
    homepage = "https://github.com/nvarner/typst-lsp";
    changelog = "https://github.com/nvarner/typst-lsp/releases/tag/${src.rev}";
    license = with licenses; [ mit ];
    maintainers = with maintainers; [ figsoda GaetanLepage ];
  };
}