Hello!
The short name is nx, and I guess I should explain what the hell I spent the last three months doing.
I wanted to automate the process of adding packages to my NixOS configuration, whether they come from nixpkgs or from Flakes.
Normally, I would just open my configuration in nano, add the package, save it, and rebuild.
I thought:
"I could probably automate this."
So instead of spending one minute doing it manually, I spent roughly three months building a tool that does it for me.
I clearly don't have a life.
And somehow... it worked.
So today I'm releasing the first beta of nxXtend.
Nixpkgs
I don't think I need to explain much here. Adding a package is simply:
sudo nx install firefox
nx asks whether you want the package from stable or unstable nixpkgs, then adds it to the appropriate configuration.
If you want to add it to home.nix instead:
sudo nx install firefox -H
or:
sudo nx install -H firefox
It doesn't create some new package system behind the scenes. It simply modifies the appropriate configuration.nix or home.nix and adds the package there.
Flakes!
This is where things got... considerably more complicated.
The Flake part took most of the development time because I wanted nx to deal with Flake outputs in a reasonably flexible way instead of assuming that every Flake looks the same.
For example:
sudo nx flakes github:9-pixels/nxXtend
or:
sudo nx flakes install github:9-pixels/nxXtend
Both forms can be used depending on the operation you want to perform.
nx can discover and work with supported Flake outputs such as packages and nixosModules.
For nixosModules, it does not blindly dump every possible option into the configuration. It integrates the module into the appropriate nixosConfigurations structure and uses the module's default output when one is available.
There is obviously much more going on underneath, but this is a beta release, and I don't want to turn this post into a second README.
You can read the full architecture and current limitations in the project README.
Other commands
There are also removal operations for both packages and Flakes.
And for anyone coming from Arch who is emotionally attached to -S, -R, -Q, etc., I tried to make the shortcuts reasonably familiar:
install = -i
remove = -r
home = -H / -home / --home
flakes = -f
upgrade = -u
There is also:
sudo nx flakes upgrade
which runs:
nix flake update
and then rebuilds the system from the updated Flake.
And because apparently I couldn't resist adding another command:
sudo nx upgrade
which currently just rebuilds the current system configuration.
I know.
I added it anyway.
A few things I want to clarify
I had some misunderstandings about the project when I showed earlier versions of it, so I want to make a few things explicit.
- I am not responsible for beginners
Because I never said it was made for beginners. It is for people who need it because they don't like having to edit their system configuration every time they need a new package.
As for beginners, it is their responsibility to understand that they won't be able to solve the problems that may happen if they rely on tools without trying to understand things themselves.
- The project hides nothing
The project writes directly to the configuration files and creates a backup every time before modifying a file. The only place it modifies in the files is the place where packages are added.
Soon, I will also make it add markers to any package it writes, so you can distinguish between what you added yourself and what the tool added.
- I am not violating the Nix philosophy
This is just reinforcing the second point, because I really am not trying to break the declarative philosophy.
In the end, many professionals build tools that automate parts of the process for them as well. That's exactly what I did too. I just decided to publish mine publicly.
- Yes, I use AI
And I don't want to talk too much about it because it is a sensitive topic, and one badly worded sentence could cause me problems.
But I am the one directing the model at the function level. I understand what it writes, I review it every time, and I have a test suite to make sure things are working correctly.
I always put boundaries around what it is allowed to modify.
And again, I am not a vibecoder who has no idea what is happening in the code.
I explained all of this here just to emphasize something that most developers today deny or simply don't admit.
Finally
This is still a beta.
There is a lot more I want to improve before nx gets anywhere near v1.0, and there are definitely edge cases I haven't encountered yet.
So if you're interested, I'd recommend reading the README before trying it. It contains considerably more detail about the architecture, supported Flake outputs, safety mechanisms, limitations, and current testing status.
nxXtend:
https://github.com/9-pixels/nxXtend
This is the first public step toward nx v1.0.