synix/templates/container/README.md
sid 95a533c876
All checks were successful
Deploy docs / build-and-deploy (push) Successful in 3s
initial commit
2026-02-23 20:34:35 +01:00

1 KiB

NixOS Container

Imperative container NixOS configuration.

References:

Setup

In your host configuration, set:

boot.enableContainers = true;

Create a new directory and initialize the template inside of it:

nxc is an arbitrary name

mkdir -p nxc
cd nxc
nix flake init -t git+https://git.sid.ovh/sid/synix#container

Usage

Create the container:

sudo nixos-container create nxc --flake .

Start the container:

sudo nixos-container start nxc

Rebuild the container:

sudo nixos-container update nxc --flake .

Log in as root:

sudo nixos-container root-login nxc

Stop the container:

sudo nixos-container stop nxc

Destroy the container:

sudo nixos-container destroy nxc

For more, see the help page:

nixos-container --help