nixos-container Command Examples

Starts NixOS containers using Linux containers. More information: https://nixos.org/manual/nixos/stable/#ch-containers.

sudo nixos-container list

sudo nixos-container create {{container_name}} --config-file {{nix_config_file_path}}

sudo nixos-container {{start|stop|terminate|destroy|status}} {{container_name}}

sudo nixos-container run {{container_name}} -- {{command}} {{command_arguments}}

sudo $EDITOR /var/lib/container/{{container_name}}/etc/nixos/configuration.nix && sudo nixos-container update {{container_name}}

sudo nixos-container root-login {{container_name}}