nix-darwin · NixOS · homebrew

nex the briw.

Manage packages across Nix and Homebrew. Define machines with TOML profiles. Provision NixOS from a USB stick.

curl -fsSL https://nex.styrene.io/install.sh | sh click to copy

or cargo install nex-pkg · nix profile add github:styrene-lab/nex

v0.22.1 Armory status fix

Armory lock status works on fresh systems

nex lock status now reports an absent package lock as an empty state and runs before config resolution, so fresh systems can inspect Armory status before a Nex repo exists.

~
$ nex install htop bat eza
  + htop
  + bat
  + eza
>>> switching...
>>> done

$ nex install --cask slack
  + slack
>>> switching...
>>> done

$ nex remove htop
  - htop
>>> switching...
>>> done

How it works

Install

nex install foo resolves whether a package belongs in Nix or Homebrew, edits the right config file, and rebuilds. Works on macOS and NixOS.

Profile

A TOML file that defines your machine: packages, shell, git, system preferences, GPU drivers, desktop environment. Profiles compose via extends for team/personal layering.

Forge

nex forge user/profile --disk /dev/sdX burns a bootable NixOS USB with your profile baked in. nex polymerize is the guided installer on the target.

Build

nex build-image user/profile produces an OCI container from a profile. Same packages, different target. Podman, docker, or any OCI runtime.

Develop

nex develop user/repo enters a flake dev shell. nex dev user/repo adds omegon as the AI coding agent.

Rollback

Every install is backed up before rebuild. If the build fails, config is restored. nex rollback reverts the system to the previous generation.

Commands

nex init Bootstrap nix-darwin or NixOS
nex install htop Add a package
nex remove htop Remove a package
nex profile apply user/repo Apply a machine profile
nex profile sign user/repo Sign a profile with identity
nex forge Build a NixOS USB (interactive)
nex polymerize Install NixOS (on target)
nex build-image user/profile Build an OCI container
nex dev user/repo Dev shell + omegon
nex switch Rebuild and activate
nex rollback Revert to previous generation
nex update Update inputs + rebuild
nex doctor Check and fix issues
nex relocate Move config to user-writable dir
nex adopt Capture existing brew packages
nex identity init Create a Styrene mesh identity
nex self-update Update nex itself
nex try htop Ephemeral shell (no install)

Why nex?

Before

vim ~/macos-nix/nix/modules/home/base.nix
# which list was it... brews? casks?
darwin-rebuild switch --flake .#Chriss-MacBook
# build failed. revert manually.
# new linux box? start over.
# container? write a Dockerfile.

After

nex install zed
# resolves source, edits config, rebuilds.

nex profile apply user/my-profile
# mac, linux, or container. same file.

nex forge user/my-profile --disk /dev/sdX
# bootable NixOS USB. one command.