Home Explore Blog Models CI



nixpkgs

nixos/doc/manual/development/non-switchable-systems.section.md
fbb36af2bbbf21021c7a13251e0d045d5f7fe80d83d226ba000000030000033c
# Non Switchable Systems {#sec-non-switchable-system}

In certain systems, most notably image based appliances, updates are handled
outside the system. This means that you do not need to rebuild your
configuration on the system itself anymore.

If you want to build such a system, you can use the `image-based-appliance`
profile:

```nix
{ modulesPath, ... }:
{
  imports = [ "${modulesPath}/profiles/image-based-appliance.nix" ];
}
```

The most notable deviation of this profile from a standard NixOS configuration
is that after building it, you cannot switch *to* the configuration anymore.
The profile sets `config.system.switch.enable = false;`, which excludes
`switch-to-configuration`, the central script called by `nixos-rebuild`, from
your system. Removing this script makes the image lighter and slightly more
secure.

Chunks
c538db70 (1st chunk of `nixos/doc/manual/development/non-switchable-systems.section.md`)
Title: Non-Switchable Systems and Image-Based Appliances
Summary
This section introduces "Non-Switchable Systems," particularly relevant for image-based appliances where updates are managed externally, eliminating the need to rebuild configurations directly on the system. To implement such a system, users can employ the `image-based-appliance` NixOS profile. A key feature of this profile is the disabling of `config.system.switch.enable`, which removes the `switch-to-configuration` script. This results in a lighter and slightly more secure system, but means the configuration cannot be switched to after building.