summaryrefslogtreecommitdiffstats
path: root/pkgs/by-name/sy/systemd-language-server/package.nix
blob: b54c4064af854974de0de6ecae17838a256ef161 (plain)
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
{
  lib,
  stdenv,
  python3Packages,
  fetchFromGitHub,
  pandoc,
}:

let
  pythonPackages = python3Packages.overrideScope (
    self: super: {
      lsprotocol = self.lsprotocol_2023;
      pygls = self.pygls_1;
    }
  );
in
pythonPackages.buildPythonApplication (finalAttrs: {
  pname = "systemd-language-server";
  version = "0.3.5";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "psacawa";
    repo = "systemd-language-server";
    tag = finalAttrs.version;
    hash = "sha256-QRd2mV4qRh4OfVJ2/5cOm3Wh8ydsLTG9Twp346DHjs0=";
  };

  build-system = with pythonPackages; [
    poetry-core
  ];

  pythonRelaxDeps = [
    "lxml"
  ];
  dependencies = with pythonPackages; [
    lxml
    pygls
  ];

  pythonImportsCheck = [ "systemd_language_server" ];

  nativeCheckInputs = [
    pandoc
    pythonPackages.pytestCheckHook
  ];

  disabledTests = lib.optionals stdenv.hostPlatform.isDarwin [
    # TimeoutError
    "test_hover"
  ];

  __darwinAllowLocalNetworking = true;

  meta = {
    description = "Language Server for Systemd unit files";
    homepage = "https://github.com/psacawa/systemd-language-server";
    changelog = "https://github.com/psacawa/systemd-language-server/releases/tag/${finalAttrs.version}";
    license = lib.licenses.gpl3Only;
    maintainers = with lib.maintainers; [ GaetanLepage ];
    mainProgram = "systemd-language-server";
  };
})