Watch
0
0
Fork
You've already forked hyperhive
0

fetch vale styles in nix, pinned, and drop vale sync

This commit is contained in:
atlas 2026-10-28 21:45:15 +01:00
commit 9ed7ebab91

30
nix/packages/vale.nix Normal file
View 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}"
''