-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathflake.nix
More file actions
69 lines (59 loc) · 1.95 KB
/
Copy pathflake.nix
File metadata and controls
69 lines (59 loc) · 1.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
{
description = "VoxTerm — local offline voice transcription TUI";
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; };
python = pkgs.python312;
isDarwin = pkgs.stdenv.isDarwin;
isLinux = pkgs.stdenv.isLinux;
# System libraries needed at runtime
darwinDeps = with pkgs; [
apple-sdk_15
swiftPackages.swift
];
linuxDeps = with pkgs; [
pulseaudio
alsa-lib
alsa-plugins
# Dictation mode — keyboard injection
xdotool
wtype
ydotool
# Dictation mode — tray icon
libappindicator-gtk3
gobject-introspection
];
commonDeps = with pkgs; [
portaudio
ffmpeg
];
in {
devShells.default = pkgs.mkShell {
name = "voxterm";
packages = with pkgs; [
python
python.pkgs.pip
] ++ commonDeps
++ pkgs.lib.optionals isDarwin darwinDeps
++ pkgs.lib.optionals isLinux linuxDeps;
shellHook = ''
# Create venv if it doesn't exist
if [ ! -d .venv ]; then
echo "Creating Python virtual environment..."
${python}/bin/python3 -m venv .venv
fi
source .venv/bin/activate
# Ensure pip can find native libs
export LD_LIBRARY_PATH="${pkgs.lib.makeLibraryPath (commonDeps ++ pkgs.lib.optionals isLinux linuxDeps)}''${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
'' + pkgs.lib.optionalString isDarwin ''
export DYLD_LIBRARY_PATH="${pkgs.lib.makeLibraryPath commonDeps}''${DYLD_LIBRARY_PATH:+:$DYLD_LIBRARY_PATH}"
'';
};
}
);
}