Skip to main content

Configuration & Policy

Complete Configuration Guide for OMG

This guide covers all configuration options, file locations, security policies, and customization options for OMG.


📍 File Locations

OMG follows the XDG Base Directory Specification with sensible fallbacks.

Configuration Files

FilePurposeDefault Path
config.tomlGeneral settings~/.config/omg/config.toml
policy.tomlSecurity policy~/.config/omg/policy.toml

Data Directory

DirectoryPurposeDefault Path
Data rootAll OMG data~/.local/share/omg/
VersionsRuntime installations~/.local/share/omg/versions/
ToolsInstalled CLI tools~/.local/share/omg/tools/
MiseBundled mise binary~/.local/share/omg/mise/
CachePersistent cache (redb)~/.local/share/omg/cache.redb
HistoryTransaction history~/.local/share/omg/history.json
AuditAudit log~/.local/share/omg/audit/audit.jsonl

⚙️ General Configuration (config.toml)

The main configuration file controls daemon behavior, runtime settings, and feature toggles.

Complete Example

# ~/.config/omg/config.toml

# ═══════════════════════════════════════════════════════════════════════════
# GENERAL SETTINGS
# ═══════════════════════════════════════════════════════════════════════════

# Enable shim system for IDE compatibility (default: false)
# Shims are slower than PATH modification but work with all IDEs
shims_enabled = false

# Override data directory (default: ~/.local/share/omg)
# data_dir = "/custom/path/omg"

# Override socket path (default: $XDG_RUNTIME_DIR/omg.sock)
# socket_path = "/run/user/1000/omg.sock"

# Default shell for hooks and completions
# Options: "zsh", "bash", "fish"
default_shell = "zsh"

# Automatically check for runtime updates on install (default: false)
auto_update = false

# Runtime backend preference
# Options: "native", "mise", "native-then-mise" (default)
runtime_backend = "native-then-mise"

# ═══════════════════════════════════════════════════════════════════════════
# AUR BUILD SETTINGS
# ═══════════════════════════════════════════════════════════════════════════

[aur]
# Build method: "bubblewrap" (secure), "chroot", or "native" (default)
build_method = "native"

# Number of parallel AUR builds
build_concurrency = 8

# Require interactive PKGBUILD review before building (default: false)
review_pkgbuild = false

# Use stricter makepkg flags (cleanbuild/verifysource) (default: true)
secure_makepkg = true

# Allow native builds without sandboxing (default: true)
allow_unsafe_builds = true

# Use AUR metadata archive for bulk update checks (default: true)
use_metadata_archive = true

# Metadata archive cache TTL in seconds (default: 300)
metadata_cache_ttl_secs = 300

# MAKEFLAGS for building (passed to makepkg)
# makeflags = "-j8"

# Custom package destination (built packages stored here)
# pkgdest = "/home/user/.cache/omg/pkgdest"

# Custom source destination (sources downloaded here)
# srcdest = "/home/user/.cache/omg/srcdest"

# Cache built packages for faster rebuilds (default: true)
cache_builds = true

# Enable ccache for faster C/C++ builds (default: false)
enable_ccache = false
# ccache_dir = "/home/user/.cache/ccache"

# Enable sccache for faster Rust builds (default: false)
enable_sccache = false
# sccache_dir = "/home/user/.cache/sccache"

Setting Descriptions

General Settings

SettingTypeDefaultDescription
shims_enabledboolfalseUse shims instead of PATH modification
data_dirstring~/.local/share/omgOverride data directory
socket_pathstringXDG runtimeOverride socket path
default_shellstring"zsh"Default shell for hooks
auto_updateboolfalseAuto-check for updates
runtime_backendstring"native-then-mise"Runtime resolution strategy

AUR Settings

SettingTypeDefaultDescription
build_methodstring"native"Build isolation method (bubblewrap, chroot, native)
build_concurrencyintCPU countParallel AUR builds
review_pkgbuildboolfalseRequire manual PKGBUILD review
secure_makepkgbooltrueUse cleanbuild/verifysource
use_metadata_archivebooltrueUse bulk metadata for fast updates
cache_buildsbooltrueCache built packages
enable_ccacheboolfalseUse ccache for C/C++
enable_sccacheboolfalseUse sccache for Rust

🛡️ Security Policy (policy.toml)

The security policy controls what packages can be installed and their required security grades.

Complete Example

# ~/.config/omg/policy.toml

# ═══════════════════════════════════════════════════════════════════════════
# SECURITY POLICY CONFIGURATION
# ═══════════════════════════════════════════════════════════════════════════

# Minimum required security grade for package installation
# Options: "Risk", "Community", "Verified", "Locked"
#
# Grade hierarchy (lowest to highest):
# Risk - Known vulnerabilities present
# Community - AUR/unsigned packages
# Verified - PGP/checksum verified (official repos)
# Locked - SLSA Level 3 + PGP verified (core packages)
minimum_grade = "Verified"

# Allow installation of AUR packages
# Set to false to restrict to official repos only
allow_aur = true

# Require PGP signature verification for all packages
# When true, unsigned packages will be rejected
require_pgp = false

# Allowed software licenses (SPDX identifiers)
# Leave empty to allow all licenses
# When populated, only packages with these licenses can be installed
allowed_licenses = [
"AGPL-3.0-or-later",
"Apache-2.0",
"MIT",
"BSD-2-Clause",
"BSD-3-Clause",
"GPL-2.0-or-later",
"GPL-3.0-or-later",
"LGPL-2.1-or-later",
"LGPL-3.0-or-later",
"MPL-2.0",
"ISC",
"Unlicense",
"CC0-1.0",
]

# Explicitly banned packages (will never be installed)
# Useful for blocking packages with known issues
banned_packages = [
# "example-malicious-package",
# "deprecated-insecure-tool",
]

# ═══════════════════════════════════════════════════════════════════════════
# ADVANCED POLICY OPTIONS
# ═══════════════════════════════════════════════════════════════════════════

# Block packages with known CVEs above this severity (0.0-10.0)
# max_cve_severity = 7.0

# Require SBOM for installed packages
# require_sbom = false

# Enable SLSA provenance verification
# verify_slsa = true

# Trusted packagers/maintainers
# trusted_maintainers = ["username1", "username2"]

Security Grades Explained

GradeLevelDescriptionExamples
Locked3SLSA Level 3 + PGP verifiedglibc, linux, pacman
Verified2PGP/checksum verifiedOfficial repo packages
Community1AUR/unsigned sourcesAUR packages
Risk0Known vulnerabilitiesCVE-affected packages

Policy Enforcement

When you run omg install:

  1. Package grading: Each package is assigned a security grade
  2. Policy check: Grade compared against minimum_grade
  3. AUR check: If AUR package and allow_aur = false, rejected
  4. PGP check: If require_pgp = true and no signature, rejected
  5. License check: If allowed_licenses is set and license not in list, rejected
  6. Ban check: If package in banned_packages, rejected

Example Policies

Permissive (Default)

minimum_grade = "Community"
allow_aur = true
require_pgp = false
allowed_licenses = []
banned_packages = []

Corporate/Secure

minimum_grade = "Verified"
allow_aur = false
require_pgp = true
allowed_licenses = ["Apache-2.0", "MIT", "BSD-3-Clause"]
banned_packages = ["known-bad-pkg"]

Paranoid/Air-gapped

minimum_grade = "Locked"
allow_aur = false
require_pgp = true
allowed_licenses = ["AGPL-3.0-or-later"]
banned_packages = []

🔄 Runtime Backend Configuration

OMG supports three runtime backends:

native

Uses OMG's built-in pure Rust runtime managers.

runtime_backend = "native"

Supported runtimes: Node, Python, Go, Rust, Ruby, Java, Bun

mise

Uses the bundled mise tool for all runtimes.

runtime_backend = "mise"

Supported runtimes: 100+ runtimes

native-then-mise (Default)

Prefers native managers, falls back to mise for unsupported runtimes.

runtime_backend = "native-then-mise"

Best of both worlds: Fast native managers + wide mise compatibility


📁 Version File Support

OMG automatically detects version files in your project:

FileRuntimeFormat
.nvmrcNode.js20.10.0 or lts/*
.node-versionNode.js20.10.0
.bun-versionBun1.0.25
.python-versionPython3.12.0
.ruby-versionRuby3.3.0
.go-versionGo1.21.0
.java-versionJava21
rust-toolchain.tomlRustTOML format (see below)
.tool-versionsMultiasdf format
.mise.tomlMultiMise format
.mise.local.tomlMultiLocal overrides
mise.tomlMultiProject root
package.jsonNode/Bunengines or volta field
go.modGogo 1.21 directive

rust-toolchain.toml Format

[toolchain]
channel = "stable" # or "nightly", "1.75.0"
components = ["rustfmt", "clippy"]
targets = ["x86_64-unknown-linux-gnu"]
profile = "minimal" # or "default", "complete"

.tool-versions Format

node 20.10.0
python 3.12.0
rust stable
go 1.21.0

.mise.toml Format

[tools]
node = "20.10.0"
python = "3.12.0"
rust = "stable"
deno = "1.40.0"

🌐 Environment Variables

OMG respects these environment variables:

VariablePurposeDefault
OMG_SOCKET_PATHOverride socket pathXDG runtime
OMG_DATA_DIROverride data directory~/.local/share/omg
OMG_CONFIG_DIROverride config directory~/.config/omg
OMG_LOG_LEVELLogging levelinfo
GITHUB_TOKENFor omg env share-
XDG_RUNTIME_DIRXDG runtime directory/run/user/$UID
XDG_DATA_HOMEXDG data directory~/.local/share
XDG_CONFIG_HOMEXDG config directory~/.config

🔧 Advanced Configuration

Systemd Service

Create a systemd user service for the daemon:

# ~/.config/systemd/user/omgd.service

[Unit]
Description=OMG Package Manager Daemon
After=network.target

[Service]
Type=simple
ExecStart=%h/.local/bin/omgd --foreground
Restart=on-failure
RestartSec=5

[Install]
WantedBy=default.target

Enable and start:

systemctl --user daemon-reload
systemctl --user enable omgd
systemctl --user start omgd

Shell Hook Customization

The shell hook adds these functions to Zsh:

FunctionDescription
omg-ecExplicit package count (cached)
omg-tcTotal package count (cached)
omg-ocOrphan count (cached)
omg-ucUpdates count (cached)
omg-explicit-countFresh explicit count
omg-total-countFresh total count
omg-orphan-countFresh orphan count
omg-updates-countFresh updates count

Use in your prompt:

# In .zshrc PROMPT
PROMPT='$(omg-ec) pkgs %~$ '

Custom Mirrors (Future)

# In config.toml (planned)
[mirrors]
arch = "https://custom-mirror.example.com/archlinux"
aur = "https://aur.archlinux.org"

📋 Configuration Examples

Minimal Configuration

# ~/.config/omg/config.toml
# Empty file uses all defaults

Developer Workstation

# ~/.config/omg/config.toml
default_shell = "zsh"
runtime_backend = "native-then-mise"

[aur]
build_concurrency = 16
enable_ccache = true
cache_builds = true

CI/CD Server

# ~/.config/omg/config.toml
auto_update = false
runtime_backend = "native"

[daemon]
refresh_interval = 60
cache_ttl = 60

[aur]
build_concurrency = 4
cache_builds = false

Enterprise/Secure

# ~/.config/omg/config.toml
[daemon]
max_cache_entries = 5000
cache_ttl = 600
# ~/.config/omg/policy.toml
minimum_grade = "Verified"
allow_aur = false
require_pgp = true
allowed_licenses = ["Apache-2.0", "MIT", "BSD-3-Clause"]
banned_packages = []

🔍 Troubleshooting Configuration

Verify Configuration

# Check config file syntax
omg doctor

# View effective configuration
omg status

Common Issues

IssueSolution
Config not loadingCheck file path and TOML syntax
Permission deniedEnsure socket/data dirs are writable
Policy blocking packagesLower minimum_grade or set allow_aur = true
Runtime not foundCheck runtime_backend setting

Reset to Defaults

# Remove config files
rm ~/.config/omg/config.toml
rm ~/.config/omg/policy.toml

# OMG will use defaults
omg status

📚 See Also