commands.sh

nixos-rebuild

linux

Reconfigure a NixOS machine.

More info →

Options (1)

-p, --profile-nameboolean

Build and switch to the new configuration, making it the boot default and naming the boot entry

Example: sudo nixos-rebuild switch {{[-p|--profile-name]}} {{name}}

Examples (8)

Build and switch to the new configuration, making it the boot default

Build and switch to the new configuration, making it the boot default and naming the boot entry

sudo nixos-rebuild switch [-p|--profile-name] name

Build and switch to the new configuration, making it the boot default and installing updates

sudo nixos-rebuild switch --upgrade

Rollback changes to the configuration, switching to the previous generation

sudo nixos-rebuild switch --rollback

Build the new configuration and make it the boot default without switching to it

Build and activate the new configuration, but don't make a boot entry (for testing purposes)

Build the configuration and open it in a virtual machine

List available generations similar to the boot loader menu

nixos-rebuild list-generations
made by @shridhargupta | data from tldr-pages