nixos-container

Starts NixOS containers using Linux containers.

TLDR

List running containers

$ sudo nixos-container list
copy

Create a NixOS container with a specific configuration file

$ sudo nixos-container create [container_name] --config-file [nix_config_file_path]
copy

Start, stop, terminate, or destroy a specific container

$ sudo nixos-container [start|stop|terminate|destroy|status] [container_name]
copy

Run a command in a running container

$ sudo nixos-container run [container_name] -- [command] [command_arguments]
copy

Update a container configuration

$ sudo $EDITOR /var/lib/container/[container_name]/etc/nixos/configuration.nix && sudo nixos-container update [container_name]
copy

Enter an interactive shell session on an already-running container

$ sudo nixos-container root-login [container_name]
copy

Copied to clipboard
coinbase