feat(build): nix multi-OS package manager install (#2806)

Integrated into release/v3.8.6
This commit is contained in:
levonk
2026-05-28 18:08:19 -07:00
committed by GitHub
parent 5197d10636
commit 12bacb03d4
6 changed files with 152 additions and 0 deletions

3
.gitignore vendored
View File

@@ -35,6 +35,9 @@ node_modules/
.data/
.next-playwright/
# devbox
.devbox/
# testing
coverage/
coverage**

View File

@@ -509,6 +509,17 @@ pnpm install -g omniroute && pnpm approve-builds -g && omniroute
yay -S omniroute-bin && systemctl --user enable --now omniroute.service
```
**🔧 Nix (Flake)**
```bash
# Using Nix flakes
nix develop
npm run dev
# Or using devbox
devbox run npm run dev
```
📖 [Docker Guide](docs/guides/DOCKER_GUIDE.md) — Compose profiles, Caddy HTTPS, Cloudflare tunnels.
</details>

17
devbox.json Normal file
View File

@@ -0,0 +1,17 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"name": "omniroute",
"version": "3.8.2",
"description": "Unified AI router with 160+ providers, RTK+Caveman compression, auto fallback, MCP/A2A, desktop, PWA, and OpenAI-compatible APIs.",
"packages": [
"nodejs_22",
],
"shell": {
"init_hook": [
"echo 'Welcome to OmniRoute dev environment'",
],
"hooks": {
"on_create": "npm install"
}
}
}

26
devbox.lock Normal file
View File

@@ -0,0 +1,26 @@
{
"lockfile_version": "1",
"packages": {
"eslint": {
"resolved": "github:NixOS/nixpkgs/6dedf69f94d03cbe7bdde106f2d4c23ae2a853bf#eslint",
"source": "nixpkg"
},
"github:NixOS/nixpkgs/nixpkgs-unstable": {
"last_modified": "2026-05-22T01:51:30Z",
"resolved": "github:NixOS/nixpkgs/6dedf69f94d03cbe7bdde106f2d4c23ae2a853bf?lastModified=1779414690"
},
"nodejs_22": {
"plugin_version": "0.0.2",
"resolved": "github:NixOS/nixpkgs/6dedf69f94d03cbe7bdde106f2d4c23ae2a853bf#nodejs_22",
"source": "nixpkg"
},
"pnpm": {
"resolved": "github:NixOS/nixpkgs/6dedf69f94d03cbe7bdde106f2d4c23ae2a853bf#pnpm",
"source": "nixpkg"
},
"typescript": {
"resolved": "github:NixOS/nixpkgs/6dedf69f94d03cbe7bdde106f2d4c23ae2a853bf#typescript",
"source": "nixpkg"
}
}
}

61
flake.lock generated Normal file
View File

@@ -0,0 +1,61 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1779467186,
"narHash": "sha256-nOesoDCiXcUftqbRBMz9tt4blI5PvljMWbm3kuCA+0s=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "b77b3de8775677f84492abe84635f87b0e153f0f",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-25.11",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

34
flake.nix Normal file
View File

@@ -0,0 +1,34 @@
{
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 = pkgs.nodejs_22;
in
{
devShells.default = pkgs.mkShell {
buildInputs = [
nodejs
];
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
'';
};
}
);
}