You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: rewrite README and remove registry references
Rewrote the "Why" section to focus on key differentiators (version
pinning, version switching, ephemeral exec). Removed all registry
references from README and AGENTS.md since the registry was replaced
by aliases.json.
Copy file name to clipboardExpand all lines: AGENTS.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,13 +14,13 @@ Zig 0.15+ required. This is Zig 0.15 which uses newer APIs (`std.Io.Writer.Alloc
14
14
15
15
## Architecture
16
16
17
-
Onyx is a package manager with two install paths: **registry packages** (resolved via Onyx registry, fetched from the Nix binary cache) and **third-party packages** (GitHub/domain sources with `onyx.toml` manifests, installed directly).
17
+
Onyx is a package manager with two install paths: **Nix packages** (resolved via aliases + Nixhub API, fetched from the Nix binary cache) and **third-party packages** (GitHub/domain sources with `onyx.toml` manifests, installed directly).
18
18
19
19
### Source files
20
20
21
21
-**main.zig** — CLI entry point, all command implementations (`cmdInstall`, `cmdExec`, `cmdUninstall`, `cmdUse`, `cmdGc`, `cmdUpgrade`, `cmdInit`, `cmdImplode`)
22
22
-**cli.zig** — argument parsing, `PackageRef` (name@version), `Command` union
23
-
-**resolver.zig** — registry alias resolution, Nixhub API calls, index caching with TTL
23
+
-**resolver.zig** — alias resolution, Nixhub API calls, index caching with TTL
**Third-party path**: `resolveGithub`/`resolveDomain` → download binary/tarball → install to `/opt/onyx/packages/{name}/{version}/` → symlink to `~/.local/bin/`
36
36
@@ -39,7 +39,7 @@ Both paths store state in `~/.local/share/onyx/state.json` and create symlinks i
39
39
### Key patterns
40
40
41
41
-**Locking**: `acquireLock`/`releaseLock` via file lock on `~/.local/share/onyx/lock`. Commands that mutate state (`install`, `uninstall`, `use`, `gc`, `upgrade`) must hold the lock. `cmdInstall` wraps `cmdInstallInner` to avoid recursive lock acquisition when installing dependencies.
42
-
-**Alias resolution**: `resolveAlias` checks `~/.cache/onyx/index.json`. Fast commands (`exec`, `use`, `list`) use cached index forever. Slow commands (`install`, `upgrade`) refresh if >1 day old via `resolveAliasFresh`.
42
+
-**Alias resolution**: `resolveAlias` checks `~/.cache/onyx/aliases.json`. Fast commands (`exec`, `use`, `list`) use cached aliases forever. Slow commands (`install`, `upgrade`) refresh if >1 day old via `resolveAliasFresh`.
43
43
-**Ephemeral packages**: `exec` auto-installs packages marked `ephemeral: true` with `last_used` timestamp. These are hidden from `list` and cleaned by `gc` after 30 days.
44
44
-**Symlink ownership**: `removeSymlinks` uses `readLink` to verify the symlink points to `/nix/store/` or `/onyx/packages/` before deleting — never removes files owned by other tools.
45
45
-**exec fast path**: `cmdExec` checks state.json first. If the package is already installed, it skips all network calls and directly `execv`s into the binary.
Copy file name to clipboardExpand all lines: README.md
+16-27Lines changed: 16 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Onyx
2
2
3
-
Onyx is a package manager that combines a curated registry with the Nix binary cache. The registry provides name resolution and aliases; the Nix cache provides 80,000+ prebuilt packages. Third-party packages skip Nix entirely — they publish an onyx.toml with download URLs and install directly to `~/.local/bin`.
3
+
Onyx is a package manager backed by the Nix binary cache — 80,000+ prebuilt packages, installed in seconds. Third-party packages skip Nix entirely — they publish an onyx.toml with download URLs and install directly to `~/.local/bin`.
-**None of the complexity** — no Ruby, no Nix language, no learning curve
20
+
Onyx gives you the cache without the overhead. One static binary under 1 MB, no configuration, no new language to learn.
21
+
22
+
-**Version pinning** — `onyx install node@20` and `node@22` live side by side, each install is atomic
23
+
-**Version switching** — `onyx use node@20` flips the active version instantly
24
+
-**Run without installing** — `onyx x jq -- '.name' package.json` fetches and runs, `onyx gc` cleans up after 30 days
25
+
-**Cross-platform** — same tool, same packages on Linux and macOS
26
+
-**Extensible** — third-party packages via simple TOML manifests, no Nix expressions needed
30
27
31
28
## Quickstart
32
29
@@ -78,22 +75,14 @@ Third-party packages (`user:repo`, `domain.com`) skip the nix store entirely and
78
75
79
76
```mermaid
80
77
flowchart LR
81
-
A[onyx install nodejs@22] --> B
82
-
83
-
subgraph B[Registry]
84
-
direction TB
85
-
B1[Resolve alias] --> B2{Onyx package?}
86
-
end
87
-
88
-
B2 -->|yes| D[Install to ~/.local/share/onyx/]
89
-
B2 -->|no| C[Nixhub API]
90
-
C --> E[cache.nixos.org]
91
-
E --> F[Install to /nix/store/]
92
-
D -->|symlink| G[~/.local/bin/]
93
-
F -->|symlink| G
78
+
A[onyx install nodejs@22] --> B[Resolve alias]
79
+
B --> C[Nixhub API]
80
+
C --> D[cache.nixos.org]
81
+
D --> E[Install to /nix/store/]
82
+
E -->|symlink| F[~/.local/bin/]
94
83
```
95
84
96
-
The [Onyx registry](https://github.com/lilienblum/onyx/tree/registry/v0) is checked first. If it has a direct package definition, the binary is downloaded and installed. Otherwise, the name is resolved through the Nix path — Nixhub API, dependency closure from `cache.nixos.org`, parallel download, unpack, and symlink into `~/.local/bin/`.
85
+
Aliases (`node` → `nodejs`) are resolved first, then the Nixhub API finds the package, its dependency closure is fetched in parallel from `cache.nixos.org`, unpacked to `/nix/store/`, and symlinked into `~/.local/bin/`.
97
86
98
87
Third-party packages (`user:repo`, `domain.com`) fetch an `onyx.toml` manifest, download the binary for your platform, verify SHA256, and install directly — no nix store involved.
0 commit comments