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?


1 Like

See also https://github.com/NixOS/nixpkgs/pull/48122#issuecomment-430344548.

1 Like