nixpkgs/pkgs/tools/text/vale/default.nix

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

59 lines
1.4 KiB
Nix
Raw Normal View History

2024-03-30 04:20:00 +00:00
{ lib
, buildGoModule
, fetchFromGitHub
, makeBinaryWrapper
, runCommand
, symlinkJoin
, vale
, valeStyles
}:
2018-03-10 22:28:02 +00:00
buildGoModule rec {
2019-08-20 13:54:18 +01:00
pname = "vale";
version = "3.7.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-rngqTCnNQCecf/W2GkpJfKtfxfPq9Dd7yQlHzb2waKs=";
2018-03-10 22:28:02 +00:00
};
2024-06-09 05:19:36 +01:00
vendorHash = "sha256-OLlViQKLTark9yknnjJFiEThFtxNNjue5LUp1P/anKU=";
2021-08-26 07:45:51 +01:00
ldflags = [ "-s" "-w" "-X main.version=${version}" ];
# Tests require network access
doCheck = false;
2024-03-30 04:20:00 +00:00
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 = with lib; {
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:
vale.withStyles (s: [ s.alex s.google ])
'';
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";
2018-03-10 22:28:02 +00:00
license = licenses.mit;
2024-04-30 18:06:40 +01:00
maintainers = [ maintainers.pbsds ];
2018-03-10 22:28:02 +00:00
};
}