Files
speech-detection/flake.nix
T
2026-07-29 03:23:08 +02:00

66 lines
1.5 KiB
Nix

{
description = "Nix development flake for speech-detection";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixpkgs-unstable";
utils.url = "github:numtide/flake-utils";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{
self,
nixpkgs,
utils,
rust-overlay,
...
}:
utils.lib.eachDefaultSystem (
system:
let
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs {
inherit system overlays;
};
rust = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
libPath =
with pkgs;
lib.makeLibraryPath [
gcc.cc.lib
];
in
{
devShells = {
default =
with pkgs;
mkShell {
buildInputs = [
rust
cargo-nextest
fish
pkg-config
fontconfig
stdenv.cc.cc.lib
];
env.RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
LD_LIBRARY_PATH = "$LD_LIBRARY_PATH:${libPath}";
shellHook = ''
echo Entered Rust dev shell for project speech-detection
export LIBC_PATH=${pkgs.stdenv.cc.cc.lib}/lib/
exec fish -C "set -ax LD_LIBRARY_PATH $PWD/vosk-linux-x86_64-0.3.45"
'';
};
};
}
);
}