01 / 06

Install

The installer builds Nyx from source on your machine: it clones the repository, compiles the compiler and the tools, and links one command into your PATH. It runs on Linux and nowhere else — install.sh stops with an error on any other operating system.

What you need

Three programs — clang, make and git — and three sets of development headers: libgc, OpenSSL and zlib. You do not have to install them yourself: the installer checks for each one and installs whatever is missing with the package manager it finds — apt, dnf, pacman, apk, xbps, or pkg on Termux. Outside Termux it uses sudo to do it.

Operating systemLinux. Anything else stops the installer with an error.
Architecturesx86_64, aarch64, armv7l.
Also supportedTermux on Android, which uses pkg and needs no sudo.

Install

$ curl -sSf https://nyxlang.com/install.sh | sh

That is the whole installation. It takes a few minutes, most of it spent compiling.

What the installer does

  1. Checks the platform. Linux plus one of the three architectures above, or it stops.
  2. Checks the dependencies and installs the missing ones with your package manager.
  3. Clones the repository into ~/.nyx. If ~/.nyx is already a git clone it fetches and resets it instead.
  4. Builds the compiler from the LLVM IR seed files committed in the repository.
  5. Builds the tools: the package manager, the test runner, the checker, vet and the formatter. Each one is a separate binary, and all of them are built here — that is why the install is not instant.
  6. Organises the tree: the binaries move to ~/.nyx/bin/ and everything that is not needed to run Nyx is removed, keeping the C runtime, the standard library, the project templates and the changelog.
  7. Links the command: ~/.local/bin/nyx points at the wrapper inside ~/.nyx. On Termux the link goes to $PREFIX/bin/nyx instead.
  8. Fixes your PATH if ~/.local/bin was not on it, by appending one export line to ~/.bashrc, ~/.zshrc or ~/.profile — whichever exists first.

Verify

$ nyx --version
nyx 0.31.0

If the shell answers command not found, the link exists but this shell has not picked up the new PATH yet. See Common problems below.

Update

$ nyx update

It fetches the latest version into ~/.nyx, rebuilds the compiler and the five tools, and then prints two things worth reading: What's new, the changelog entries between the version you had and the one you now have, and the traps you no longer have to dodge — the gotchas that were fixed in between, taken from the toolchain's own table rather than from a hand-written list.

Updating the toolchain does not update the documents already seeded inside your projects. Inside a project, nyx update --sync-docs refreshes them and leaves a .bak of anything it replaces. Step 04 covers what those documents are.

Uninstall

$ nyx uninstall
Uninstalling Nyx...
Nyx has been uninstalled.
  Removed: ~/.nyx/
  Removed: ~/.local/bin/nyx

It removes ~/.nyx and ~/.local/bin/nyx. Your projects are untouched — they are ordinary directories with source files.

Termux

Termux is detected on its own and treated as a first-class target: packages come from pkg, nothing runs under sudo, and the command is linked into $PREFIX/bin, which is already on your PATH — so there is no profile to edit and no new shell to open.

Build from source instead

If you would rather not run an installer, the repository builds by itself. This is also the path to take if you want to work on the compiler.

$ sudo apt install clang make git libgc-dev libssl-dev zlib1g-dev
$ git clone https://github.com/nyxlang-dev/nyx.git
$ cd nyx
$ make bootstrap

make bootstrap produces nyx_bootstrap from the LLVM IR seed files committed in the repository — that is how a self-hosted compiler builds without already having itself installed.

Common problems

No supported package manager found

The installer knows apt, dnf, pacman, apk, xbps and Termux's pkg. On anything else it stops and prints the list of packages it wanted; install them by hand with your own package manager and run the installer again.

nyx: command not found, right after installing

The link is there; this shell's PATH is not. The installer says so when it happens, and tells you which file it edited:

$ source ~/.bashrc

Opening a new terminal works just as well.

A warning about libgc during install

If your distribution ships a libgc/bdwgc older than 8.2, the installer warns and keeps going:

warn libgc/bdwgc 8.0.4-1 detected (< 8.2 required for healthy concurrency under load).

Below 8.2 one function the scheduler relies on does not exist, and the garbage collector can crash a program that runs many concurrent tasks. Single-threaded programs are unaffected. The runtime repeats the warning at startup when it happens, so the problem is never silent — but upgrading the package is the real fix.