36 releases (4 breaking)
Uses new Rust 2024
| new 0.5.1-nightly.20261124.96 | Nov 24, 2026 |
|---|---|
| 0.4.9-nightly.20261113.88 | Nov 13, 2026 |
| 0.1.8 | Jul 17, 2026 |
#1 in #home-manager
49 downloads per month
570KB
17K
SLoC
NixBox
NixBox is a desktop package manager for NixOS and Home Manager, with a terminal UI and a plain command line over the same engine. It searches the nixpkgs revision locked by your configuration, writes selected packages into generated Nix modules, imports those modules into your configuration, and runs the matching rebuild command. After nixbox profile setup, installs and removals update an independent package profile instead, without rebuilding.
What it does
- Builds and caches a searchable package catalog from the direct
nixpkgsinput in your configuration'sflake.lock. - Installs packages into separate generated modules for Home Manager and NixOS.
- Finds supported package declarations in existing configuration files and can move simple declarations into NixBox management.
- Searches GitHub for repositories with a root
flake.nixand can install a default NixOS or Home Manager module, or a package output, from a conventional flake. - Queues changes by target, combines changes that can share a rebuild, streams build output, and restores interrupted work after restart.
- Supports normal text input or Vim-style Normal, Insert, and Visual modes.
Requirements
- A working Nix installation with flakes enabled.
- A flake-based NixOS or Home Manager configuration. NixBox looks in
~/.config/nixosunlessNIXBOX_CONFIG_DIRchanges that location. sudoaccess for NixOS rebuilds.- An authenticated GitHub CLI session from
gh auth loginif you use the flake browser.
Install
NixBox has three independently installed interfaces. Each package installs only its own interface:
| Package | Command | Run without a subcommand |
|---|---|---|
nixbox |
nixbox-gui |
opens the desktop GUI |
nixbox-tui |
nixbox-tui |
opens the terminal UI |
nixbox-cli |
nixbox, nb, nixbox-cli |
nixbox and nb show help |
On Linux, install the desktop GUI from the flake to get its native libraries and runtime wrapper without configuring a build environment. The package includes a desktop entry and icon for application menus:
nix profile install github:SINGH-RAJVEER/nixbox
The CLI is a separate installation. Installing the GUI or TUI does not provide nixbox or nb, include CLI subcommands, or intercept terminal commands. The GUI's Settings > Terminal applications shows flake installation commands for the TUI and CLI. See Terminal applications.
The GUI is also published to crates.io. Its default Cargo installation is a small launcher that runs the matching flake package, so it needs Nix with flakes enabled but no graphics development libraries:
cargo install nixbox
For the terminal UI, or the command line with no interface at all, install the sibling packages instead:
cargo install nixbox-tui
cargo install nixbox-cli
Stable releases use plain versions such as 0.4.5. Nightly builds from dev use prerelease versions such as 0.4.6-nightly.20261025.123. Install a published nightly explicitly with cargo install nixbox --version '=0.4.6-nightly.20261025.123', or pin its Nix tag with nix profile install github:SINGH-RAJVEER/nixbox/v0.4.6-nightly.20261025.123#nixbox-nightly. Replace the example identifier with an existing published version. Both channels support the separate nixbox-tui and nixbox-cli packages. See release preparation for the --stable and --nightly versioning flags.
The flake defaults to the stable GUI on Linux. Select the GUI explicitly with #nixbox-stable or #nixbox-nightly; terminal outputs are #nixbox-tui-stable, #nixbox-tui-nightly, #nixbox-cli-stable, and #nixbox-cli-nightly. For example, nix run .#nixbox-nightly runs this checkout's GUI, while nix run . runs the pinned stable 0.4.5 GUI. The unsuffixed interface outputs select stable. On macOS, the default is the stable TUI because the GUI is not packaged there. Nightly version tags require #nixbox-nightly to select the nightly GUI.
Run NixBox directly from its flake:
nix run github:SINGH-RAJVEER/nixbox
Add NixBox to another flake:
{
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
inputs.nixbox.url = "github:SINGH-RAJVEER/nixbox";
inputs.nixbox.inputs.nixpkgs.follows = "nixpkgs";
outputs = { nixpkgs, nixbox, ... }: {
nixosConfigurations.nixos = nixpkgs.lib.nixosSystem {
modules = [
./configuration.nix
({ pkgs, ... }: {
environment.systemPackages = [ nixbox.packages.${pkgs.stdenv.hostPlatform.system}.default ];
})
];
};
};
}
For a standalone Home Manager configuration, add the same input and include its package in the modules passed to home-manager.lib.homeManagerConfiguration:
({ pkgs, ... }: {
home.packages = [ nixbox.packages.${pkgs.stdenv.hostPlatform.system}.default ];
})
Here nixbox is the flake input available in the enclosing outputs function. .default is the desktop GUI on Linux and the terminal UI on macOS. Use .nixbox-tui for the terminal UI or .nixbox-cli for the command-line-only binary.
The flake also exports overlays.default, which adds pkgs.nixbox, pkgs.nixbox-tui, and pkgs.nixbox-cli:
nixpkgs.overlays = [ inputs.nixbox.overlays.default ];
environment.systemPackages = [ pkgs.nixbox ];
Supported flake package systems are x86_64-linux, aarch64-linux, and aarch64-darwin. The desktop GUI is built for the Linux systems only.
Nix builds reuse compiled dependency artifacts after application source edits. Installation packages build separately from their test checks. The public NixBox binary cache can supply matching builds without local compilation; downstream NixOS configurations must enable its cache and verification key explicitly.
NixBox's flake packages build with every core Nix allows, including test compilation. On a machine with little RAM, cap the package with (nixbox.packages.${pkgs.stdenv.hostPlatform.system}.default.override { buildJobs = 2; }), or pkgs.nixbox.override { buildJobs = 2; } when using the overlay. The Cargo launcher inherits your Nix settings. To cap direct native Cargo installs, use cargo install nixbox --features native --locked --jobs 2; the same --jobs option applies to nixbox-tui and nixbox-cli. See build resource limits for tuning and the distinction between package and system-wide limits.
Run
nixbox-gui
Run nixbox-gui or use the desktop entry for the GUI, and nixbox-tui for the terminal UI. Install nixbox-cli separately for nixbox command ... and nb command .... All interfaces share the engine, settings, and managed files.
First run
NixBox loads both generated package modules, scans the configured Home Manager and NixOS entry files, restores queued work from ~/.config/nixbox/state.json, and starts preparing the package catalog. If the catalog cache does not match the locked nixpkgs revision, Nix evaluates the full package set once. Later searches use the cache without starting Nix.
Installing a package writes a generated module before the rebuild starts. NixBox does not roll back that file if the rebuild fails, so the generated module continues to describe the requested state and the failure remains visible on the next launch.
Documentation
- Documentation index
- User guide
- Command line interface
- Configuration and stored state
- Architecture
- Package search
- Managed files and package operations
- GitHub flake browser
- Development and testing
- Troubleshooting
- Release notes
CLI
Install the CLI separately with nix profile add github:SINGH-RAJVEER/nixbox#nixbox-cli. nixbox and nb show help without arguments and never open a GUI or TUI. Neither has a --gui or --tui option.
nixbox search ripgrep # search the configured channel
nixbox install ripgrep # add it, wire the import, rebuild
nixbox remove ripgrep # drop it and rebuild
nixbox list # what NixBox manages
nixbox scan # packages you declared by hand
nixbox migrate htop # move one of them into the managed file
nixbox apply # rewrite the managed file and rebuild
nixbox profile setup # install packages into a profile instead of rebuilding
nixbox resume # finish an interrupted rebuild or a queued batch
nixbox status # target, paths, and how they are wired
nixbox doctor # check what NixBox depends on
Flake modules work the same way:
nixbox flake search nix-index # needs `gh auth login`
nixbox flake info Mic92/nix-index-database
nixbox flake add Mic92/nix-index-database
nixbox flake list
nixbox flake remove Mic92/nix-index-database
Settings can be read and changed without opening an interface:
nixbox config show
nixbox config set channel nixpkgs-unstable
nixbox config path
nixbox completions fish > ~/.config/fish/completions/nixbox.fish
Flags
| flag | effect |
|---|---|
-t, --target |
act on home-manager or nixos for this invocation only |
-c, --channel |
use another channel for this invocation only |
--json |
machine-readable output instead of a table |
--dry-run |
print the plan and stop, writing nothing |
--no-rebuild |
write the configuration but skip the rebuild or profile update |
-y, --yes |
do not ask before changing the configuration |
Anything that changes your configuration asks first. Without a terminal to ask at, it refuses unless you pass --yes, so a script can never trigger a rebuild by accident. --target and --channel never touch settings.json — only nixbox config set does.
The configuration is always written before the rebuild starts. If a rebuild fails or you interrupt it with Ctrl-C, your files already hold the change: fix the problem and run the nixbox apply command the failure message names to finish.
Every front-end shares ~/.config/nixbox/state.json. nixbox resume picks up a rebuild that was killed partway, or applies a batch you queued in an interface and never ran; --dry-run shows it first and --discard throws it away.
Every command above also works under nb and nixbox-cli. The independently installed GUI and TUI do not accept CLI subcommands.
Exit codes
| code | meaning |
|---|---|
| 0 | success |
| 1 | NixBox could not do what you asked, or the run was cancelled |
| 2 | the command line could not be parsed |
| 3 | the configuration was written but the rebuild failed |
Structured output goes to stdout and progress to stderr, so nixbox list --json | jq works while a rebuild is streaming.
Development
Use the pinned devenv shell so Cargo, Rust, Nix, and Clippy come from one toolchain:
devenv shell
just ci
See the development guide for repository layout, commands, tests, lint policy, Nix packaging, Jujutsu usage, and release preparation.
License
NixBox is licensed under Apache-2.0. See LICENSE.
Dependencies
~0–60MB
~1M SLoC