synix/templates/container
sid ecf5132cbb
Some checks failed
Build tests / build-hosts (pull_request) Failing after 3s
Flake check / flake-check (pull_request) Failing after 13s
enforce new flake schema. formatting.
2026-05-31 18:50:41 +02:00
..
config initial commit 2026-02-23 20:34:35 +01:00
modules initial commit 2026-02-23 20:34:35 +01:00
overlays initial commit 2026-02-23 20:34:35 +01:00
pkgs initial commit 2026-02-23 20:34:35 +01:00
.gitignore enforce new flake schema. formatting. 2026-05-31 18:50:41 +02:00
flake.nix enforce new flake schema. formatting. 2026-05-31 18:50:41 +02:00
README.md initial commit 2026-02-23 20:34:35 +01:00

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