English | Русский
Declarative NixOS/home-manager CLI package manager written in Rust. Tired of editing 'configuration.nix' every time you need a package? Niux lets you manage packages with short commands.
Working with home-manager and NixOS is powerful, but constantly editing configuration files and running switch can feel tedious.
Niux makes it simple and fast: a lightweight CLI that lets you install, remove, and manage packages declaratively with short, intuitive commands — like apt or pacman, but without breaking Nix's declarative philosophy.
- Install with one command (
niux -Hi firefox) - Automatically rebuild configs when needed
- Update flakes, clean up the system, and more
- Built in Rust — fast, reliable, and secure
In short: Niux brings the convenience of traditional package managers to NixOS and home-manager while staying fully declarative.
- Fast and lightweight command-line interface
- Manage home and system packages declaratively
- Built with Rust for performance and reliability
- Simple and intuitive command syntax
- Supports both standalone and module home-manager
- Supports NixOS with and without flakes
- Hooks which allow to automate actions
- NixOS
Add to your flake.nix inputs:
inputs.niux = {
url = "github:sayavc/niux";
inputs.nixpkgs.follows = "nixpkgs";
};Pass niux to home-manager via extraSpecialArgs:
homeConfigurations.youruser = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
extraSpecialArgs = { inputs = { inherit niux; }; };
modules = [ ./home/home.nix ];
};Then add to your home.nix:
{ inputs, pkgs, ... }: {
home.packages = [
inputs.niux.packages.${pkgs.system}.default
];
}Run home-manager switch to apply.
Note: Non-flake and NixOS module home-manager installation docs coming soon, Contributions welcome!
First, generate the default config:
niux --gen-configOr at a custom path:
niux --gen-config --default-path-config ~/my/path/niux.kdlTo display the path:
niux --get-current-pathNote:
--default-path-configrequires an existing.kdlfile. Always run--gen-configfirst.
niux -Hi firefox # Install firefox for home
niux -Si vim # Install vim for system
niux -Hr firefox # Remove firefox from home
niux -Hl # List home packages
niux -l firefox # Search everywhere
niux -U # Update all flakes
niux -USHa # Update + rebuild everything
niux -HSa # Rebuild both configsniux -Hi firefox # Install firefox for home
niux -Hia firefox # Install and rebuild home
niux -Si vim # Install vim for system
niux -Sia vim # Install and rebuild system
niux -Hi firefox vim # Install multiple packages for home
niux -Si firefox vim # Install multiple packages for system
niux -Hr firefox # Remove firefox from home
niux -Hra firefox # Remove and rebuild home
niux -Sr vim # Remove vim from system
niux -Sra vim # Remove and rebuild system
niux -Hr firefox vim # Remove multiple from home
niux -Sr firefox vim # Remove multiple from systemniux -l # List all packages
niux -Hl # List home packages
niux -Sl # List system packages
niux -l firefox # Search everywhere
niux -Hl firefox # Search in home
niux -Sl firefox # Search in system
niux -l firefox vim # Search multipleniux -U # Update all flakes
niux -U nixpkgs # Update specific flake input
niux -HUa # Update + rebuild home
niux -SUa # Update + rebuild system
niux -USHa # Update + rebuild everything
niux -HUa nixpkgs # Update nixpkgs + rebuild home
niux -SUa nixpkgs # Update nixpkgs + rebuild systemniux -Ha # Rebuild home config
niux -Sa # Rebuild system config
niux -HSa # Rebuild both configsniux --clear # Run nix-collect-garbageCheck in /etc/niux_hooks.kdl example:
actions {
action "post-rebuild"
run "zsh /etc/niux_post_rebuild.zsh"
}| Flag | Description |
|---|---|
-H, --home |
Target home packages |
-S, --system |
Target system packages |
-i, --install |
Install packages |
-r, --remove |
Remove packages |
-a, --apply |
Apply and rebuild configuration |
-l, --list |
List or search packages |
-U, --update |
Update flakes |
--gen-config |
Generate default configuration |
--default-path-config |
Use custom config path |
--clear |
Run garbage collection |
Contributions are welcome! Please open an issue or submit a pull request.
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.
Created by sayavc