check / check (push) Canceled after 0s
The agent's ears and voice: a server on the home server transcribes a clip (sox, whisper.cpp) and speaks text (piper), one job at a time. A gate hands the capability to whoever presents its key; the key comes from systemd's credentials, not argv. make test runs the unit tests in Nix's sandbox; make smoke starts a real server on localhost, speaks a phrase, and hears it back. Generated-by: Claude Opus 5.5
32 lines
1.2 KiB
Nix
32 lines
1.2 KiB
Nix
# pdtv26-speech: the speech capability's JavaScript, and its clients.
|
|
# npm runs here, in Nix's build sandbox, from package-lock.json; so do the tests.
|
|
# The output is plain JavaScript, the same on every architecture (allowedReferences keeps it so):
|
|
# each user supplies its own node, at lib/node_modules/pdtv26-speech/*.js.
|
|
{ lib, buildNpmPackage }:
|
|
buildNpmPackage {
|
|
pname = "pdtv26-speech";
|
|
version = "0.1.0";
|
|
src = lib.fileset.toSource {
|
|
root = ./.;
|
|
fileset = lib.fileset.unions [
|
|
./package.json ./package-lock.json ./run.js
|
|
./gate.js ./gate.test.js ./speech.js ./speech.test.js
|
|
./server.js ./hear-client.js ./speak-client.js
|
|
];
|
|
};
|
|
npmDepsHash = "sha256-C7Em37Mm3+mUHqQ2n37JshgLCByzMOlhgoQEex3CnlU=";
|
|
dontNpmBuild = true;
|
|
# The scripts' #!/usr/bin/env node stays as is: patched, it would tie the package to one node.
|
|
dontPatchShebangs = true;
|
|
npmInstallFlags = [ "--ignore-scripts" ];
|
|
doCheck = true;
|
|
checkPhase = ''
|
|
runHook preCheck
|
|
# Every file parses, the server and clients included: no test imports them.
|
|
for f in *.js; do node --check "$f"; done
|
|
node --test
|
|
runHook postCheck
|
|
'';
|
|
allowedReferences = [ ];
|
|
}
|