61 lines
1.5 KiB
Nix
61 lines
1.5 KiB
Nix
|
|
{
|
||
|
|
description = "Voice-activated eye pressure classifier";
|
||
|
|
|
||
|
|
inputs = {
|
||
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||
|
|
flake-utils.url = "github:numtide/flake-utils";
|
||
|
|
};
|
||
|
|
|
||
|
|
outputs = { self, nixpkgs, flake-utils }:
|
||
|
|
flake-utils.lib.eachDefaultSystem (system:
|
||
|
|
let
|
||
|
|
pkgs = import nixpkgs {
|
||
|
|
inherit system;
|
||
|
|
config.allowUnfree = true;
|
||
|
|
config.cudaSupport = true;
|
||
|
|
};
|
||
|
|
in
|
||
|
|
{
|
||
|
|
devShells.default = pkgs.mkShell {
|
||
|
|
buildInputs = with pkgs; [
|
||
|
|
# Python and uv
|
||
|
|
python313
|
||
|
|
uv
|
||
|
|
|
||
|
|
# Audio
|
||
|
|
portaudio
|
||
|
|
pipewire
|
||
|
|
alsa-lib
|
||
|
|
ffmpeg
|
||
|
|
|
||
|
|
# CUDA (for faster-whisper)
|
||
|
|
cudaPackages.cudatoolkit
|
||
|
|
cudaPackages.cudnn
|
||
|
|
|
||
|
|
# SSL certificates
|
||
|
|
cacert
|
||
|
|
|
||
|
|
# Text-to-speech
|
||
|
|
espeak-ng
|
||
|
|
];
|
||
|
|
|
||
|
|
shellHook = ''
|
||
|
|
export LD_LIBRARY_PATH="${pkgs.lib.makeLibraryPath [
|
||
|
|
pkgs.portaudio
|
||
|
|
pkgs.pipewire
|
||
|
|
pkgs.alsa-lib
|
||
|
|
pkgs.cudaPackages.cudatoolkit
|
||
|
|
pkgs.cudaPackages.cudnn
|
||
|
|
]}:/run/opengl-driver/lib:$LD_LIBRARY_PATH"
|
||
|
|
|
||
|
|
export SSL_CERT_FILE="${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt"
|
||
|
|
export REQUESTS_CA_BUNDLE="$SSL_CERT_FILE"
|
||
|
|
|
||
|
|
echo "Voice classifier dev environment"
|
||
|
|
echo "Run: uv run python listener.py"
|
||
|
|
'';
|
||
|
|
};
|
||
|
|
}
|
||
|
|
);
|
||
|
|
}
|