A terminal user interface (TUI) for managing NixOS rebuilds across multiple hosts.
- Multi-host management: Manage local and remote NixOS systems from one interface
- Live output streaming: Watch rebuild progress in real-time with scrollable output
- Interactive prompts: PTY-based terminal with input mode for sudo passwords and interactive commands
- Operation switching: Easily switch between switch, boot, test, build, dry-build, and dry-activate
- Flake support: Automatic discovery of NixOS configurations from flakes
- Configurable: Per-host connection settings and extra arguments
- Safe operations: Confirmation prompts and build cancellation support
- Keyboard-driven: Vim-style navigation and intuitive keybindings
Add renix as a flake input:
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
renix.url = "github:sarahlament/renix";
};
outputs = { nixpkgs, renix, ... }: {
nixosConfigurations.your-host = nixpkgs.lib.nixosSystem {
modules = [
renix.nixosModules.default
{
programs.renix.enable = true;
}
];
};
};
}{
inputs.renix.url = "github:sarahlament/renix";
outputs = { nixpkgs, renix, ... }: {
nixosConfigurations.your-host = nixpkgs.lib.nixosSystem {
modules = [
{
nixpkgs.overlays = [ renix.overlays.default ];
environment.systemPackages = [ pkgs.renix ];
}
];
};
};
}nix profile install github:sarahlament/renixOr run without installing:
nix run github:sarahlament/renix-
Launch renix: Run
renixin your terminal -
Set flake path (first time):
- Press
fto edit flake path - Enter the path to your NixOS flake (e.g.,
/etc/nixosor~/nixos-config) - Press Enter to save
- Press
-
Configure hosts:
- Select a host with
↑/↓orj/k - Press
cto set connection:localhostfor local systemuser@hostnamefor SSH remote
- Press
ato add extra nixos-rebuild arguments
- Select a host with
-
Rebuild:
- Switch operations with
h/lor←/→ - Toggle
--upgradeflag withu - Press
Enterto start rebuild - Watch live output (scroll with
j/k,PageUp/PageDown) - If prompted for password, press
ito enter input mode - Type password and press
Enter, thenEscto exit input mode
- Switch operations with
Configuration is stored at ~/.config/renix/config.toml:
flake_path = "/etc/nixos"
[hosts.desktop]
connection = "Local"
extra_args = []
[hosts.server]
connection = { Remote = "user@server.example.com" }
extra_args = ["--option", "substitute", "false"]↑/↓orj/k- Navigate hosts (or scroll output when available)←/→orh/l- Switch rebuild operation (switch, boot, test, etc.)Tab- Toggle between main and settings panelPageUp/PageDown- Scroll output by 10 linesHome/End- Jump to top/bottom of output
Enter- Start rebuild for selected hostu- Toggle--upgradeflagi- Enter input mode (for typing passwords or interactive input)Esc- Cancel running build / Exit input modeq- Quit (press twice during build to cancel and quit)
f- Edit flake pathc- Edit host connectiona- Edit extra arguments for selected host
When editing:
- Type to input text
Backspaceto deleteEnterto saveEscto cancel
When in input mode (press i during build):
- Type your password or input
Enterto submitBackspaceto delete charactersEscto exit input mode- Input is sent directly to the build process (PTY)
- Nix with flakes enabled
- Rust toolchain (provided by dev shell)
# Clone the repository
git clone https://github.com/sarahlament/renix.git
cd renix
# Enter development shell
nix develop
# Build
cargo build
# Run
cargo runrenix/
├── src/
│ ├── main.rs # Entry point and CLI
│ ├── app.rs # Application state and logic
│ ├── config/ # Configuration management
│ ├── nix/ # Nix command execution
│ └── ui/ # TUI rendering
├── nix/
│ └── module.nix # NixOS module
├── flake.nix # Nix flake with package, module, and overlay
└── Cargo.toml # Rust dependencies
Ensure nixos-rebuild is in your PATH. This should be automatic on NixOS systems.
- Verify SSH access:
ssh user@host - Ensure the remote user has sudo privileges
- Check that the target configuration exists in your flake
Renix creates ~/.config/renix/config.toml on first run. If changes aren't saving, check file permissions.
- Build history viewer
- Search/filter in output
- Multiple simultaneous builds
- Color themes
- Home Manager support
MIT License - see LICENSE for details.
Contributions are welcome! Please feel free to submit issues or pull requests.
Sarah (@sarahlament)
- Email: sarah@lament.gay
Built with: