nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 makeWrapper,
6 rustPlatform,
7 pkg-config,
8 openssl,
9 vale,
10}:
11
12rustPlatform.buildRustPackage rec {
13 pname = "vale-ls";
14 version = "0.3.8";
15
16 src = fetchFromGitHub {
17 owner = "errata-ai";
18 repo = "vale-ls";
19 tag = "v${version}";
20 hash = "sha256-+2peLqj3/ny0hDwJVKEp2XS68VO50IvpCB2fvZoEdJo=";
21 };
22
23 nativeBuildInputs = [
24 rustPlatform.bindgenHook
25 pkg-config
26 makeWrapper
27 ];
28
29 buildInputs = [
30 openssl
31 ];
32
33 checkFlags = [
34 # The following tests are reaching to the network.
35 "--skip=vale::tests"
36 ]
37 ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [
38 # This test does not account for the existence of aarch64-linux machines,
39 # despite upstream shipping artifacts for that architecture
40 "--skip=utils::tests::arch"
41 ];
42
43 env.OPENSSL_NO_VENDOR = true;
44
45 cargoHash = "sha256-KPgi0wZh1+PTKUmvCkLGPf+DZW5Tt4dQVK/cdxjm/1A=";
46
47 postInstall = ''
48 wrapProgram $out/bin/vale-ls \
49 --suffix PATH : ${lib.makeBinPath [ vale ]}
50 '';
51
52 meta = with lib; {
53 description = "LSP implementation for the Vale command-line tool";
54 homepage = "https://github.com/errata-ai/vale-ls";
55 license = licenses.mit;
56 mainProgram = "vale-ls";
57 maintainers = with maintainers; [
58 foo-dogsquared
59 jansol
60 ];
61 };
62}