
PhoeNix: managing NixOS machines through templates, flakes, PXE and nixos-anywhere
Hi fellow Nix enjoyers,
like many of you, I manage my homelab and personal machines with NixOS. I really like the stability, reproducibility and the ability I manage my homelab and personal machines with NixOS. I to see exactly what is deployed by looking at a Git repository.
Over time, I found myself repeatedly needing to spin up small NixOS VMs and machines that shared most of their configuration, but differed in a few parameters. I also wanted a more convenient way to keep track of those machines, update them, monitor their state and test configurations before deploying them.
That led me to build PhoeNix: a web-based platform for provisioning, configuring and managing NixOS machines.
The goal is not to replace tools like nixos-anywhere, disko, nixos-rebuild or Prometheus. Instead, PhoeNix tries to provide a higher-level interface around them: a central machine inventory, reusable configuration modules, provisioning workflows, metrics and update management in one place.
The main problems I wanted to solve were:
- no central inventory of machines
- no convenient way to update multiple machines
- no real-time view of machine state
- no easy overview of hardware, storage, network usage and other metrics
- no end-to-end workflow from bare metal or VM to configured NixOS machine
- too much repeated manual work when managing similar machines with small differences
With PhoeNix, I wanted to make it possible to:
- build reusable configurations for multiple machines from modules
- parameterize those modules per machine
- deploy configurations to one or more machines
- keep an inventory of machines
- check whether machines are alive and up to date
- view hardware information and Prometheus metrics
- test individual modules and system configurations before deployment
- provision a machine and then continue managing it from the same interface
So far, I have used it for things like:
- TeamSpeak server
- UniFi controller
- Nix cache
- test VMs with different desktop environments
The repository is here: https://github.com/Dyrkon/PhoeNix
If you just want to see how it looks, I created a walkthrough documentation to show what can the app do: UI documentation
I would really appreciate feedback, suggestions and feature requests, especially from people managing multiple NixOS machines today.
More technical details
PhoeNix currently uses:
- a web UI with machine inventory
- live metrics from Prometheus
- PXE-based provisioning via
pixiecore - hardware probing based on
nixos-facter nixos-anywhereanddiskofor installation/orchestrationnixos-rebuildfor updates- a templating/module system for reusable machine configuration
- clean architecture to make the provisioning and deployment pipeline easier to extend or replace
This is not a purely Nix-based application. I wanted an interactive platform where machines can move through different states during installation, probing, configuration, deployment and updates. For that reason, PhoeNix has an application backend and database in addition to the generated Nix configuration.
One design question I had was: why build a templating system when the NixOS module system already exists?
The reason is that I wanted to decompose NixOS configurations into reusable building blocks that can be applied to multiple machines with different parameters. The NixOS module system is still the foundation, but PhoeNix adds a layer where each module can expose only the few variables that matter for a specific use case, provide sane defaults and make the configuration easier to reuse across machines.
The generated configuration remains inspectable and exportable. I do not want the UI to become an opaque replacement for Nix configuration. Ideally, PhoeNix should make the workflow more convenient while still keeping the benefits of NixOS: reproducibility, declarative configuration and the ability to understand what is being deployed.
I also experimented with an MCP server. Since Nix configuration is infrastructure as code, it seemed interesting to expose machine inventory, configurations, provisioning logs and update errors to agents. The MCP server can read and edit configurations, create new ones, search through the machine inventory and help debug provisioning/orchestration/update problems.
Some features I would like to add or evaluate next:
- Secure Boot support, especially around PXE provisioning
- secrets management
- IPv6 support
- support for multiple NICs per machine
- Proxmox integration for creating, starting and stopping VMs
- Git integration for configuration sharing
- configuration versioning
- software inventory, such as running services, open ports and possible vulnerabilities
- evaluating whether a dendritic pattern would make configuration composition easier
- Management of existing NixOS machines
- Full flake import
I am especially interested in feedback on the overall direction:
- Would a tool like this be useful in your NixOS workflow?
- Should the project be Git-first, database-first or some hybrid of both?
- Which existing tools should PhoeNix integrate with instead of reimplementing?
- What prevents you from using PhoeNix with the current feature set?
This is a repost from NixOS forums: https://discourse.nixos.org/t/phoenix-managing-nixos-machines-through-templates-flakes-pxe-and-nixos-anywhere/78143