NixOS package for OpenViking — an agent-native context database for AI agents by ByteDance/Volcengine.
OpenViking organizes agent context (memory, resources, skills) through a virtual filesystem paradigm using viking:// protocol paths. It features tiered context loading (L0/L1/L2), hierarchical RAG, automatic session management, and a chat bot framework.
This repo packages the entire OpenViking stack for NixOS from its monorepo:
| Component | Language | Output |
|---|---|---|
| ov CLI | Rust | ov binary |
| RAGFS binding | Rust (PyO3) | ragfs_python extension module |
| Vector engine | C++17 / pybind11 | embedded in the Python package |
| OpenViking | Python (FastAPI) | server + client library |
| Package | Description |
|---|---|
openviking (default) |
Full package with server, CLI, vector engine, and all native components |
ragfs-python |
Rust RAGFS PyO3 binding (ragfs_python extension) |
ov-cli |
OpenViking Rust CLI client |
The main openviking package provides 4 binaries: openviking-server, openviking, ov, vikingbot.
| Project | volcengine/OpenViking |
| License | Apache-2.0 |
| Tracked | GitHub releases |
Add as a flake input:
{
inputs.openviking = {
url = "github:Daaboulex/openviking-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
}Then add the overlay:
nixpkgs.overlays = [ inputs.openviking.overlays.default ];Import the NixOS module:
imports = [ inputs.openviking.nixosModules.default ];inputs.openviking = {
url = "github:Daaboulex/openviking-nix";
inputs.nixpkgs.follows = "nixpkgs";
};nixpkgs.overlays = [ inputs.openviking.overlays.default ];
# Provides: pkgs.openviking, pkgs.ov-cli, pkgs.ragfs-pythonimports = [ inputs.openviking.nixosModules.default ];
services.openviking = {
enable = true;
port = 1933; # default
host = "127.0.0.1"; # default
dataDir = "/var/lib/openviking";
# configFile = /path/to/ov.conf;
openFirewall = false; # default
};The service runs with DynamicUser, ProtectSystem=strict, NoNewPrivileges, and other systemd hardening options.
| Option | Type | Default | Description |
|---|---|---|---|
services.openviking.enable |
bool | false |
Enable the OpenViking server |
services.openviking.package |
package | openviking |
Package to use |
services.openviking.user |
string | "openviking" |
User account to run as |
services.openviking.group |
string | "openviking" |
Group account to run as |
services.openviking.extraGroups |
list of string | [] |
Extra groups for the service |
services.openviking.port |
port | 1933 |
Server listen port |
services.openviking.host |
string | "127.0.0.1" |
Server bind address |
services.openviking.dataDir |
string | "/var/lib/openviking" |
Data/workspace directory |
services.openviking.settings |
null or attrs | null |
Declarative ov.conf settings |
services.openviking.readOnlyPaths |
list of string | [] |
Extra paths for the service to read |
services.openviking.configFile |
null or path | null |
Path to ov.conf (defaults to dataDir/ov.conf) |
services.openviking.openFirewall |
bool | false |
Open firewall for server port |
services.openviking = {
enable = true;
user = "user"; # Run as primary user to solve all permission issues for local indexing
group = "users";
readOnlyPaths = [ "/home/user/Documents/my-project" ];
settings = {
embedding.dense = {
provider = "openai";
model = "text-embedding-004";
api_key = "your-api-key"; # Use sops-nix for security
api_base = "https://generativelanguage.googleapis.com/v1beta/openai/";
dimension = 768;
};
vlm = {
provider = "litellm";
model = "gemini/gemini-2.0-flash";
api_key = "your-api-key";
};
};
};Note: Declarative configuration will place secrets in the Nix store. Use configFile pointing to a sops-managed file for production use.
OpenViking runs as a system user with ProtectHome=true by default. To index local directories in /home:
- Run as your user: Set
services.openviking.user = "youruser";(Easiest and recommended for personal workstations). - Alternatively: Keep
openvikinguser, setservices.openviking.readOnlyPaths = [ "/path" ];, and ensure permissions are correct on your home directory.
Supports OpenAI, Volcengine, Jina, and LiteLLM (for Claude, Gemini, etc.) providers. See OpenViking docs for the full config reference.
x86_64-linux only.
- OpenViking by ByteDance/Volcengine (Apache-2.0)
- Nix packaging by @Daaboulex
git clone https://github.com/Daaboulex/openviking-nix
cd openviking-nix
nix develop # enter dev shell, installs pre-commit hooks
nix fmt # format flake
nix flake check --no-build # eval check
nix build # builds the full openviking package
nix build .#ragfs-python # Rust RAGFS binding only
nix build .#ov-cli # Rust CLI only
./result/bin/openviking --version # binary verifyCI runs the same chain daily; manual updates rarely needed.
This module declares options under services.openviking. See module.nix for all available options.
The Nix packaging code in this repo is MIT licensed. Upstream OpenViking is Apache-2.0.