fetch vale styles in nix, pinned, and drop vale sync
This commit is contained in:
parent
1971c6773a
commit
9ed7ebab91
1 changed files with 90 additions and 20 deletions
30
nix/packages/vale.nix
Normal file
30
nix/packages/vale.nix
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
lib,
|
||||
vale,
|
||||
runCommand,
|
||||
makeWrapper,
|
||||
callPackage,
|
||||
}:
|
||||
|
||||
# `vale` with the repo's `.vale.ini` and the pinned styles from
|
||||
# ./vale-styles.nix baked in, so `vale docs` works from the repo root without
|
||||
# any setup step. CI, the devshell and local runs all
|
||||
# take this one binary. `.vale.ini` carries no `StylesPath`; the wrapper's
|
||||
# generated config prepends the store path to the file's contents.
|
||||
let
|
||||
styles = callPackage ./vale-styles.nix { };
|
||||
config = runCommand "vale.ini" { } ''
|
||||
{ echo "StylesPath = ${styles}"; cat ${../../.vale.ini}; } > $out
|
||||
'';
|
||||
in
|
||||
runCommand "vale-${vale.version}-hyperhive"
|
||||
{
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
meta = {
|
||||
description = "vale preconfigured with the repo's .vale.ini and pinned style packages";
|
||||
mainProgram = "vale";
|
||||
};
|
||||
}
|
||||
''
|
||||
makeWrapper ${lib.getExe vale} $out/bin/vale --add-flags "--config ${config}"
|
||||
''
|
||||
Loading…
Reference in a new issue