nixos-configs/devices/nos/modules/subtitles/syncing/node-syncsub/default.nix
matt1432 902364e391
All checks were successful
Discord / discord commits (push) Has been skipped
feat(node-subsync): use ffprobe to check available languages
2024-03-27 01:27:11 -04:00

33 lines
566 B
Nix

{
buildNpmPackage,
ffmpeg,
nodejs_20,
subsync,
typescript,
...
}:
buildNpmPackage {
name = "node-syncsub";
src = ./.;
npmDepsHash = "sha256-O00VQPCUX6T+rtK3VcAibBipXFwNs4AFA3251qycPBQ=";
nativeBuildInputs = [
nodejs_20
ffmpeg
subsync
typescript
];
buildPhase = ''
tsc -p tsconfig.json
'';
installPhase = ''
mkdir -p $out/bin
mv node_modules package.json $out
echo '#!/usr/bin/env node' > $out/bin/node-syncsub
cat ./build/main.js >> $out/bin/node-syncsub
chmod +x $out/bin/node-syncsub
'';
}