1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-17 19:21:04 +00:00
nixpkgs/pkgs/by-name/va/vale/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

66 lines
1.5 KiB
Nix
Raw Permalink Normal View History

{
lib,
buildGoModule,
fetchFromGitHub,
makeBinaryWrapper,
symlinkJoin,
vale,
valeStyles,
2024-03-30 04:20:00 +00:00
}:
2018-03-10 22:28:02 +00:00
buildGoModule rec {
2019-08-20 13:54:18 +01:00
pname = "vale";
version = "3.9.0";
2018-03-10 22:28:02 +00:00
2021-01-20 04:20:00 +00:00
subPackages = [ "cmd/vale" ];
2019-02-24 01:25:21 +00:00
2018-03-10 22:28:02 +00:00
src = fetchFromGitHub {
2021-10-16 07:56:04 +01:00
owner = "errata-ai";
repo = "vale";
rev = "v${version}";
hash = "sha256-4zDngF2K6Fsn/Ml4rhHQxDXOD7meXePoqZ9+XPrHO0g=";
2018-03-10 22:28:02 +00:00
};
vendorHash = "sha256-EWAgzb3ruxYqaP+owcyGDzNnkPDYp0ttHwCgNXuuTbk=";
ldflags = [
"-s"
"-X main.version=${version}"
];
# Tests require network access
doCheck = false;
passthru.withStyles =
selector:
symlinkJoin {
name = "vale-with-styles-${vale.version}";
paths = [ vale ] ++ selector valeStyles;
nativeBuildInputs = [ makeBinaryWrapper ];
postBuild = ''
wrapProgram "$out/bin/vale" \
--set VALE_STYLES_PATH "$out/share/vale/styles/"
'';
meta = {
inherit (vale.meta) mainProgram;
};
};
2024-03-30 04:20:00 +00:00
meta = {
2019-01-18 12:05:24 +00:00
description = "Syntax-aware linter for prose built with speed and extensibility in mind";
2024-03-30 04:20:00 +00:00
longDescription = ''
Vale in Nixpkgs offers the helper `.withStyles` allow you to install it
predefined styles:
```nix
vale.withStyles (s: [ s.alex s.google ])
```
2024-03-30 04:20:00 +00:00
'';
homepage = "https://vale.sh/";
changelog = "https://github.com/errata-ai/vale/releases/tag/v${version}";
2024-03-16 17:07:58 +00:00
mainProgram = "vale";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ pbsds ];
2018-03-10 22:28:02 +00:00
};
}