Home Explore Blog Models CI



nixpkgs

1st chunk of `pkgs/by-name/sw/switch-to-configuration-ng/README.md`
ef3464c468a6ef9791720007da9e4d56b90b7c8e3116d67c000000010000027f
# switch-to-configuration-ng

This program implements the switching/updating of NixOS systems. It starts with the existing running configuration at `/run/current-system` and handles the migration to a new configuration, built from a NixOS configuration's `config.system.build.toplevel` derivation.

For more information on what happens during a switch, see [what-happens-during-a-system-switch](../../../../nixos/doc/manual/development/what-happens-during-a-system-switch.chapter.md).

## Build in a devshell

```
cd ./pkgs/by-name/sw/switch-to-configuration-ng
nix-shell ../../../.. -A switch-to-configuration-ng
cd ./src
cargo build
```

Title: NixOS System Switching Program: switch-to-configuration-ng
Summary
This document introduces `switch-to-configuration-ng`, a program designed for updating and switching NixOS systems. It manages the migration from the currently running configuration (located at `/run/current-system`) to a new configuration derived from `config.system.build.toplevel`. The text also provides a reference for further details on the system switching process and includes instructions for building the program within a devshell using `nix-shell` and `cargo build`.