nixbox-0.1.4 is not a library.
NixBox
A NixOS TUI package manager. Search a nixpkgs channel, pick a package, and NixBox writes it into your home-manager or NixOS config and runs the rebuild — without ever leaving the terminal.
What it does
- Live search against
nix search --jsonover a configurable flake input (defaultnixpkgs). - Maintains two managed files in your config directory —
nixbox-home-packages.nixandnixbox-system-packages.nix— and owns them end-to-end. Your hand-written config is never touched outside of a singleimportsline. - On install/uninstall it updates the managed file, makes sure it's imported by your
home.nix/configuration.nix, then runs the appropriate rebuild and streams the output into the TUI. - Works whether your home-manager is exposed as a standalone
homeConfigurations.<user>flake output, or wired in as a NixOS module — NixBox auto-detects which one you have and picks the right rebuild command. - Scans your existing config for externally-declared packages and lets you "migrate" them into the managed file with
m(orMfor all of them). - Settings (channel, target, theme, paths) persist in
~/.config/nixbox/settings.json.
How it wires itself in
The first time you install or migrate a package, NixBox does three things automatically:
- Writes the managed file (
nixbox-home-packages.nixfor home-manager,nixbox-system-packages.nixfor NixOS). - Inserts
./nixbox-home-packages.nix(or…-system-…) into theimports = [ … ]list of yourhome.nix/configuration.nix. Existing imports-list style is preserved, and the insertion is idempotent. - Stages the managed file with
git add -Nif your config dir is a git work tree, so flakes (which ignore untracked files) can actually evaluate it.
If you want to override where NixBox looks for the "main" config file, set home_manager_main_file or nixos_main_file in ~/.config/nixbox/settings.json.
Inside the managed file, NixBox owns everything between # nixbox:packages:start and # nixbox:packages:end. Don't edit those by hand.
Install
Or build from source:
Run
Layout
Cargo workspace:
crates/nixbox— binary entrypointcrates/nixbox-tui— ratatui app, search / installed / build viewscrates/nixbox-nix—nix searchwrapper, managed-file writer, import inserter, rebuild runnercrates/nixbox-config— persisted user settings (channel, target, theme, path overrides)
Keys
| key | action |
|---|---|
type / / / i |
enter search |
↑ ↓ / k j |
move selection |
| Enter | install selected package |
d / Delete |
uninstall selected (Installed tab) |
m |
migrate selected external package |
M |
migrate all migratable externals |
Tab / l |
next tab (Search → Installed → Build) |
Shift-Tab / h |
previous tab |
| Ctrl-T | toggle home-manager / nixos target |
| Ctrl-N | cycle theme |
| Esc / Ctrl-C | quit |