Why is nixos-rebuild an output attribute of a nixos system?

There was a conversation in IRC. A user wanted to build their system in CI, using nixos-rebuild. I know that it’s not a regular package, nor part of pkgs.nix, but instead part of a built nixos system.

It can be reached like this: nix-shell -p "(nixos{}).nixos-rebuild"

But why? Why is it not in its own package? It seems specifically by design that it’s only available as part of a full nixos system evaluation?

Thanks!

1 Like

See also nixos-rebuild: init as package by zimbatm · Pull Request #48122 · NixOS/nixpkgs · GitHub.

1 Like