Repository navigation
Expand file tree
/
Copy pathflake.nix
More file actions
43 lines (39 loc) · 1.48 KB
/
Copy pathflake.nix
File metadata and controls
43 lines (39 loc) · 1.48 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
{
description = "OmniRoute - Unified AI router with 160+ providers";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
# nodejs_22 ships npm 10, which (a) rewrites package-lock.json on every
# install (drops the npm 11 `libc` fields, downgrades undici 7 -> 6) and
# (b) runs node-gyp for better-sqlite3 -> fails without Python -> npm
# silently prunes it, since it is an optionalDependency.
# node 24 ships npm 11: lockfile stays byte-identical and the bundled
# better-sqlite3 prebuild is used instead of a source build.
nodejs = pkgs.nodejs_24;
in
{
devShells.default = pkgs.mkShell {
buildInputs = [
nodejs
# Real Python for node-gyp: macOS /usr/bin/python3 is an Xcode CLT
# stub that cannot exec, so any from-source native build fails.
pkgs.python3
];
shellHook = ''
echo "Welcome to OmniRoute dev environment"
export PATH="$PWD/node_modules/.bin:$PATH"
# Install dependencies if node_modules doesn't exist
if [ ! -d "node_modules" ]; then
echo "Installing dependencies..."
npm install
fi
'';
};
}
);
}