2024-03-30 05:20:00 +01:00
|
|
|
{ lib
|
|
|
|
, buildGoModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
, makeBinaryWrapper
|
|
|
|
, runCommand
|
|
|
|
, symlinkJoin
|
|
|
|
, vale
|
|
|
|
, valeStyles
|
|
|
|
}:
|
2018-03-10 23:28:02 +01:00
|
|
|
|
2020-02-26 02:23:38 +01:00
|
|
|
buildGoModule rec {
|
2019-08-20 14:54:18 +02:00
|
|
|
pname = "vale";
|
2024-04-09 06:20:00 +02:00
|
|
|
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}";
|
2024-04-09 06:20:00 +02:00
|
|
|
hash = "sha256-fD2KBKDfKTNYuzP/zKkAx9h/HMxOlAyiWtp9EsWxop8=";
|
2018-03-10 23:28:02 +01:00
|
|
|
};
|
|
|
|
|
2024-03-11 03:39:04 +01:00
|
|
|
vendorHash = "sha256-HMzFLSmO6sBDNU89UoIvHcPPd3ubpti2ii4sFMKUDmI=";
|
2020-02-26 02:23:38 +01:00
|
|
|
|
2021-08-26 08:45:51 +02:00
|
|
|
ldflags = [ "-s" "-w" "-X main.version=${version}" ];
|
2020-02-19 00:00:00 +01:00
|
|
|
|
2022-10-06 06:20:00 +02:00
|
|
|
# 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/"
|
|
|
|
'';
|
2024-04-23 16:57:37 +02:00
|
|
|
meta = {
|
|
|
|
inherit (vale.meta) mainProgram;
|
|
|
|
};
|
2024-03-30 05:20:00 +01:00
|
|
|
};
|
|
|
|
|
2021-01-11 08:54:33 +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 ])
|
|
|
|
'';
|
2023-07-26 06:20:00 +02:00
|
|
|
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
|
|
|
};
|
|
|
|
}
|