Skip to content

Commit 6e634f6

Browse files
committed
Add roc-vad package
1 parent 96f93dc commit 6e634f6

2 files changed

Lines changed: 76 additions & 0 deletions

File tree

flake.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
prometheus-snmp-exporter-config = pkgs.callPackage ./pkgs/prometheus-snmp-exporter-config { };
7474
pyroscope = pkgs.callPackage ./pkgs/pyroscope { };
7575
rift = pkgs.callPackage ./pkgs/rift { };
76+
roc-vad = pkgs.callPackage ./pkgs/roc-vad { };
7677
sleepwatcher = pkgs.callPackage ./pkgs/sleepwatcher { };
7778
sonnenbatterie-exporter = pkgs.callPackage ./pkgs/sonnenbatterie-exporter { };
7879
tod0 = pkgs.callPackage ./pkgs/tod0 { };
@@ -198,6 +199,7 @@
198199
prometheus-snmp-exporter-config = pkgs.prometheus-snmp-exporter-config;
199200
pyroscope = pkgs.pyroscope;
200201
rift = pkgs.rift;
202+
roc-vad = pkgs.roc-vad;
201203
sleepwatcher = pkgs.sleepwatcher;
202204
sonnenbatterie-exporter = pkgs.sonnenbatterie-exporter;
203205
tod0 = pkgs.tod0;

pkgs/roc-vad/default.nix

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
{
2+
lib,
3+
stdenvNoCC,
4+
fetchurl,
5+
}:
6+
7+
stdenvNoCC.mkDerivation rec {
8+
pname = "roc-vad";
9+
version = "0.0.4";
10+
11+
src = fetchurl {
12+
url = "https://github.com/roc-streaming/roc-vad/releases/download/v${version}/roc-vad.tar.bz2";
13+
sha256 = "sha256-76OrOACS3lVBYNwCFAcC0rT5qi3bUDzyuQYYzbyV4po=";
14+
};
15+
16+
dontBuild = true;
17+
dontFixup = true;
18+
19+
sourceRoot = ".";
20+
21+
installPhase = ''
22+
runHook preInstall
23+
24+
# Install CLI tool
25+
mkdir -p $out/bin
26+
cp usr/local/bin/roc-vad $out/bin/roc-vad
27+
chmod +x $out/bin/roc-vad
28+
29+
# Install CoreAudio driver bundle
30+
mkdir -p $out/Library/Audio/Plug-Ins/HAL
31+
cp -R Library/Audio/Plug-Ins/HAL/roc_vad.driver $out/Library/Audio/Plug-Ins/HAL/
32+
33+
runHook postInstall
34+
'';
35+
36+
postInstall = ''
37+
cat << EOF
38+
39+
========================================
40+
roc-vad installation complete!
41+
========================================
42+
43+
The CLI tool is available at: $out/bin/roc-vad
44+
45+
IMPORTANT: CoreAudio Driver Installation Required
46+
--------------------------------------------------
47+
The driver bundle has been installed to the Nix store, but macOS requires
48+
it to be in the system location. To complete the installation, run:
49+
50+
sudo cp -R $out/Library/Audio/Plug-Ins/HAL/roc_vad.driver \\
51+
/Library/Audio/Plug-Ins/HAL/
52+
53+
After copying, restart coreaudiod:
54+
55+
sudo killall coreaudiod
56+
57+
To uninstall the driver later:
58+
59+
sudo rm -rf /Library/Audio/Plug-Ins/HAL/roc_vad.driver
60+
sudo killall coreaudiod
61+
62+
========================================
63+
EOF
64+
'';
65+
66+
meta = with lib; {
67+
description = "macOS Virtual Audio Device for real-time audio streaming";
68+
homepage = "https://github.com/roc-streaming/roc-vad";
69+
license = licenses.mpl20;
70+
maintainers = with maintainers; [ simonswine ];
71+
platforms = platforms.darwin;
72+
mainProgram = "roc-vad";
73+
};
74+
}

0 commit comments

Comments
 (0)