Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

11.4 KB
Raw Blame
#
# This is a Flox environment manifest.
# Visit flox.dev/docs/concepts/manifest/
# or see flox-edit(1), manifest.toml(5) for more information.
#
# Flox manifest version managed by Flox CLI
schema-version = "1.10.0"

# Floor, not a pin: warns when a developer's CLI predates what this
# environment expects, which lowers the chance an older flox rewrites
# manifest.lock differently from everyone else. It only warns, so it
# does not prevent that. Deliberately left at schema-version
# 1.10.0: the field works there, and bumping the schema would hard-gate
# anyone below flox 1.11.0 for no added effect.
minimum-cli-version = "1.19.1"

# List packages you wish to install in your environment inside
# the `[install]` section.
[install]
# Python - Python itself is installed on activation via `uv sync`
uv = { pkg-path = "flox/uv", pkg-group = "uv", version = "^0.13.4" }
# Node
nodejs = { pkg-path = "nodejs_26", pkg-group = "nodejs", version = "26.13.0" } # Same version as .nvmrc
# Node 25 and later no longer bundle corepack, so it comes from its own package, pinned like the Dockerfiles.
# A lower priority keeps its pnpm shim ahead of any pnpm on the nodejs path.
# https://flox.dev/docs/man/manifest.toml/#catalog-descriptors
corepack = { pkg-path = "corepack", pkg-group = "nodejs", version = "0.36.0", priority = 4 }
brotli = { pkg-path = "brotli", pkg-group = "nodejs" }
zstd = { pkg-path = "zstd", pkg-group = "nodejs" }
# node-rdkafka's librdkafka dlopens liblz4/libsasl2 at runtime on Linux; the .so files live outside the default outputs
lz4 = { pkg-path = "lz4", pkg-group = "nodejs", outputs = ["out", "lib", "dev"], systems = ["x86_64-linux", "aarch64-linux"] }
cyrus_sasl = { pkg-path = "cyrus_sasl", pkg-group = "nodejs", outputs = ["out", "dev"], systems = ["x86_64-linux", "aarch64-linux"] }
openssl = { pkg-path = "openssl", version = "3.4.1", pkg-group = "openssl", outputs = ["bin", "man", "dev", "out"] }
nodemon = { pkg-path = "nodemon" }
# Rust toolchain (based on https://flox.dev/docs/cookbook/languages/rust/)
cargo = { pkg-path = "cargo", pkg-group = "rust-toolchain", version = "1.91.1" }
rustc = { pkg-path = "rustc", pkg-group = "rust-toolchain" }
clippy = { pkg-path = "clippy", pkg-group = "rust-toolchain" }
rustfmt = { pkg-path = "rustfmt", pkg-group = "rust-toolchain" }
rust-lib-src = { pkg-path = "rustPlatform.rustLibSrc", pkg-group = "rust-toolchain" }
libiconv = { pkg-path = "libiconv", systems = ["aarch64-darwin"], pkg-group = "rust-toolchain" }
rust-analyzer = { pkg-path = "rust-analyzer", pkg-group = "rust-analyzer" } # rust-analyzer should be isolated in its own group, details in cookbook example
lld = { pkg-path = "lld", systems = ["aarch64-darwin"] } # Faster linker for Rust dev builds on macOS
sccache = { pkg-path = "sccache" } # Compilation cache for Rust (also used in CI)
# Go
go = { pkg-path = "go", version = "1.26.4", pkg-group = "go" }
golangci-lint = { pkg-path = "golangci-lint", pkg-group = "go" }
air = { pkg-path = "air" }
# CLI tools
ripgrep = { pkg-path = "ripgrep" }
mprocs = { pkg-path = "mprocs" }
util-linux = { pkg-path = "util-linux" } # flock
cmake = { pkg-path = "cmake", version = "3.31.5", pkg-group = "cmake" }
sqlx-cli = { pkg-path = "sqlx-cli", version = "0.8.3" } # sqlx
postgresql = { pkg-path = "postgresql_14" } # psql
ffmpeg = { pkg-path = "ffmpeg_5", version = "5.1.4", pkg-group = "ffmpeg" }
protobuf = { pkg-path = "protobuf" } # protoc compiler for gRPC code generation
ninja.pkg-path = "ninja"
emscripten = { pkg-path = "emscripten", pkg-group = "emscripten", version = "4.0.23" }
watchman = { pkg-path = "watchman" } # Fast file watching for Django/Celery autoreload (uses pywatchman)
trunk-io = { pkg-path = "trunk-io", version = "^1.3.4" } # Launcher for the Trunk merge queue CLI; the CLI version itself is pinned in .trunk/trunk.yaml
# depot-cli has its own group because the toplevel group's version pins cannot resolve with it.
# Keep its version floor current: flox puts its bin first on PATH, so an old lock shadows a newer host `depot`.
depot-cli = { pkg-path = "depot-cli", pkg-group = "depot", version = "^2.102.19" }
# hog (hog/) needs Bun 1.3.3+ to turn off .env and bunfig.toml autoloading. 1.4.2 is the newest in the catalog.
bun = { pkg-path = "bun", pkg-group = "bun", version = "^1.4.2" }

# Set environment variables in the `[vars]` section. These variables may not
# reference one another, and are added to the environment without first
# expanding them. They are available for use in the `[profile]` and `[hook]`
# scripts.
[vars]
DEBUG = "1"
POSTHOG_SKIP_MIGRATION_CHECKS = "1"
FLAGS_REDIS_URL = "redis://localhost:6379/1"
# CH client default DB. Matches docker-compose convention — without it,
# Django queries unqualified `events` / `log_entries` etc. resolve against
# the literal `default` DB (where PostHog has no tables) and 500.
CLICKHOUSE_DATABASE = "posthog"
DIRENV_LOG_FORMAT = "" # Disable direnv activation logging (in case direnv is present)
RUST_LOG = "flox=error,flox_rust_sdk=error,flox_watchdog=error" # Suppress Flox logs only (also set in .envrc for early activation)
OPENSSL_ROOT_DIR = "$FLOX_ENV"
OPENSSL_LIB_DIR = "$FLOX_ENV/lib"
DOTENV_FILE = ".env"
OPENSSL_INCLUDE_DIR = "$FLOX_ENV/include"
LDFLAGS="-L$FLOX_ENV/lib"
CPPFLAGS="-I$FLOX_ENV/include"
RUSTC_WRAPPER = "sccache"
# UV_PROJECT_ENVIRONMENT is set in the [hook]/[profile] scripts, not here: [vars]
# are added without expanding $FLOX_ENV_CACHE, so flox drops it on fresh activation.

# The `hook.on-activate` script is run by the *bash* shell immediately upon
# activating an environment, and will not be invoked if Flox detects that the
# environment has previously been activated. Variables set by the script will
# be inherited by `[profile]` scripts defined below. Note that any stdout
# generated by the script will be redirected to stderr.
[hook]
on-activate = '''
source "$FLOX_ENV_PROJECT/.flox/env/on-activate.sh"
'''

# Scripts defined in the `[profile]` section are *sourced* by *your shell* and
# inherit environment variables set in the `[vars]` section and by `[hook]` scripts.
# The `profile.common` script is sourced by all shells and special care should be
# taken to ensure compatibility with all shells, after which exactly one of
# `profile.{bash,fish,tcsh,zsh}` is sourced by the corresponding shell.
[profile]
bash = '''
  if [ -f "$HOME/.bash_profile" ]; then
    source "$HOME/.bash_profile"
  fi
  unset GOROOT
  export GOTOOLCHAIN=local
  export GOPATH="$HOME/.cache/posthog/go"
  export GOCACHE="$HOME/.cache/posthog/go-build"
  export GOMODCACHE="$GOPATH/pkg/mod"
  export GOFLAGS=-modcacherw
  # Ensure flox binaries (especially Node.js) take precedence over system binaries
  export PATH="$FLOX_ENV/bin:$PATH"
  # uv venv path — set here, not in [vars] (which can't expand $FLOX_ENV_CACHE)
  export UV_PROJECT_ENVIRONMENT="$FLOX_ENV_CACHE/venv"
  # Recreate venv if it was deleted (on-activate only runs on first activation)
  if [ ! -f "$UV_PROJECT_ENVIRONMENT/bin/activate" ]; then
    uv sync
    ln -sf "$FLOX_ENV_PROJECT/bin/hogli" "$UV_PROJECT_ENVIRONMENT/bin/hogli"
  elif [ ! -L "$UV_PROJECT_ENVIRONMENT/bin/hogli" ] || [ ! -e "$UV_PROJECT_ENVIRONMENT/bin/hogli" ]; then
    ln -sf "$FLOX_ENV_PROJECT/bin/hogli" "$UV_PROJECT_ENVIRONMENT/bin/hogli"
  fi
  source $UV_PROJECT_ENVIRONMENT/bin/activate
  # Source hogli bash completions
  [ -f "$FLOX_ENV_CACHE/completions/hogli.bash" ] && source "$FLOX_ENV_CACHE/completions/hogli.bash"
  # Load phw worktree helper
  [ -f "$FLOX_ENV_PROJECT/bin/phw" ] && source "$FLOX_ENV_PROJECT/bin/phw" >/dev/null
  # Route manually-run dependency installs (uv sync, pnpm install, ...) through the dev sandbox on macOS
  [ -f "$FLOX_ENV_PROJECT/bin/dev-sandbox-shims" ] && source "$FLOX_ENV_PROJECT/bin/dev-sandbox-shims"
'''
zsh = '''
  if [[ -f "$HOME/.zshrc" ]]; then
    source "$HOME/.zshrc"
  fi
  unset GOROOT
  export GOTOOLCHAIN=local
  export GOPATH="$HOME/.cache/posthog/go"
  export GOCACHE="$HOME/.cache/posthog/go-build"
  export GOMODCACHE="$GOPATH/pkg/mod"
  export GOFLAGS=-modcacherw
  # Ensure flox binaries (especially Node.js) take precedence over system binaries
  export PATH="$FLOX_ENV/bin:$PATH"
  # uv venv path — set here, not in [vars] (which can't expand $FLOX_ENV_CACHE)
  export UV_PROJECT_ENVIRONMENT="$FLOX_ENV_CACHE/venv"
  # Recreate venv if it was deleted (on-activate only runs on first activation)
  if [[ ! -f "$UV_PROJECT_ENVIRONMENT/bin/activate" ]]; then
    uv sync
    ln -sf "$FLOX_ENV_PROJECT/bin/hogli" "$UV_PROJECT_ENVIRONMENT/bin/hogli"
  elif [[ ! -L "$UV_PROJECT_ENVIRONMENT/bin/hogli" ]] || [[ ! -e "$UV_PROJECT_ENVIRONMENT/bin/hogli" ]]; then
    ln -sf "$FLOX_ENV_PROJECT/bin/hogli" "$UV_PROJECT_ENVIRONMENT/bin/hogli"
  fi
  source $UV_PROJECT_ENVIRONMENT/bin/activate
  # Add hogli completions to zsh
  [[ -f "$FLOX_ENV_CACHE/completions/_hogli" ]] && fpath=("$FLOX_ENV_CACHE/completions" $fpath)
  autoload -Uz compinit && compinit -i
  # Load phw worktree helper
  [[ -f "$FLOX_ENV_PROJECT/bin/phw" ]] && source "$FLOX_ENV_PROJECT/bin/phw" >/dev/null
  # Route manually-run dependency installs (uv sync, pnpm install, ...) through the dev sandbox on macOS
  [[ -f "$FLOX_ENV_PROJECT/bin/dev-sandbox-shims" ]] && source "$FLOX_ENV_PROJECT/bin/dev-sandbox-shims"
'''
fish = '''
  set -e GOROOT
  set -gx GOTOOLCHAIN local
  set -gx GOPATH "$HOME/.cache/posthog/go"
  set -gx GOCACHE "$HOME/.cache/posthog/go-build"
  set -gx GOMODCACHE "$GOPATH/pkg/mod"
  set -gx GOFLAGS -modcacherw
  # Ensure flox binaries (especially Node.js) take precedence over system binaries
  fish_add_path -g "$FLOX_ENV/bin"
  # uv venv path — set here, not in [vars] (which can't expand $FLOX_ENV_CACHE)
  set -gx UV_PROJECT_ENVIRONMENT "$FLOX_ENV_CACHE/venv"
  # Recreate venv if it was deleted (on-activate only runs on first activation)
  if not test -f "$UV_PROJECT_ENVIRONMENT/bin/activate.fish"
    uv sync
    ln -sf "$FLOX_ENV_PROJECT/bin/hogli" "$UV_PROJECT_ENVIRONMENT/bin/hogli"
  else if not test -L "$UV_PROJECT_ENVIRONMENT/bin/hogli"; or not test -e "$UV_PROJECT_ENVIRONMENT/bin/hogli"
    ln -sf "$FLOX_ENV_PROJECT/bin/hogli" "$UV_PROJECT_ENVIRONMENT/bin/hogli"
  end
  source $UV_PROJECT_ENVIRONMENT/bin/activate.fish
'''
tcsh = '''
  unsetenv GOROOT
  setenv GOTOOLCHAIN local
  setenv GOPATH "$HOME/.cache/posthog/go"
  setenv GOCACHE "$HOME/.cache/posthog/go-build"
  setenv GOMODCACHE "$GOPATH/pkg/mod"
  setenv GOFLAGS -modcacherw
  # Ensure flox binaries (especially Node.js) take precedence over system binaries
  setenv PATH "$FLOX_ENV/bin:$PATH"
  # uv venv path — set here, not in [vars] (which can't expand $FLOX_ENV_CACHE)
  setenv UV_PROJECT_ENVIRONMENT "$FLOX_ENV_CACHE/venv"
  # Recreate venv if it was deleted (on-activate only runs on first activation)
  if ( ! -f "$UV_PROJECT_ENVIRONMENT/bin/activate.csh" ) then
    uv sync
    ln -sf "$FLOX_ENV_PROJECT/bin/hogli" "$UV_PROJECT_ENVIRONMENT/bin/hogli"
  else if ( ! -l "$UV_PROJECT_ENVIRONMENT/bin/hogli" || ! -e "$UV_PROJECT_ENVIRONMENT/bin/hogli" ) then
    ln -sf "$FLOX_ENV_PROJECT/bin/hogli" "$UV_PROJECT_ENVIRONMENT/bin/hogli"
  endif
  source $UV_PROJECT_ENVIRONMENT/bin/activate.csh
'''

# The `[services]` section of the manifest allows you to define services.
# Services defined here use the packages provided by the `[install]` section
# and any variables you've defined in the `[vars]` section or `hook.on-activate` script.
[services]
# db.command = "postgres -D $FLOX_ENV_CACHE/postgres"

# Additional options can be set in the `[options]` section. Refer to
# manifest.toml(5) for a list of available options.
[options]
systems = ["aarch64-darwin", "aarch64-linux", "x86_64-linux"]