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 05:20:00 +01:00
{ lib
, buildGoModule
, fetchFromGitHub
, makeBinaryWrapper
, runCommand
, symlinkJoin
, vale
, valeStyles
}:
2018-03-10 23:28:02 +01:00
buildGoModule rec {
2019-08-20 14:54:18 +02:00
pname = "vale";
version = "3.4.1";
2018-03-10 23:28:02 +01:00
2021-01-20 05:20:00 +01:00
subPackages = [ "cmd/vale" ];
2019-02-24 02:25:21 +01:00
2018-03-10 23:28:02 +01:00
src = fetchFromGitHub {
2021-10-16 08:56:04 +02:00
owner = "errata-ai";
repo = "vale";
rev = "v${version}";
hash = "sha256-fD2KBKDfKTNYuzP/zKkAx9h/HMxOlAyiWtp9EsWxop8=";
2018-03-10 23:28:02 +01:00
};
2024-03-11 03:39:04 +01:00
vendorHash = "sha256-HMzFLSmO6sBDNU89UoIvHcPPd3ubpti2ii4sFMKUDmI=";
2021-08-26 08:45:51 +02:00
ldflags = [ "-s" "-w" "-X main.version=${version}" ];
# Tests require network access
doCheck = false;
2024-03-30 05:20:00 +01: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 05:20:00 +01:00
};
meta = with lib; {
2019-01-18 13:05:24 +01:00
description = "A syntax-aware linter for prose built with speed and extensibility in mind";
2024-03-30 05:20:00 +01: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 18:07:58 +01:00
mainProgram = "vale";
2018-03-10 23:28:02 +01:00
license = licenses.mit;
2024-04-24 06:20:00 +02:00
maintainers = [ ];
2018-03-10 23:28:02 +01:00
};
}