Merge pull request #47473 from arianvp/imperative-doc-fix
doc: Update section about imperative containers
This commit is contained in:
commit
d6665b43dd
@ -73,8 +73,7 @@ Linux foo 3.4.82 #1-NixOS SMP Thu Mar 20 14:44:05 UTC 2014 x86_64 GNU/Linux
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
There are several ways to change the configuration of the container. First,
|
To change the configuration of the container, you can edit
|
||||||
on the host, you can edit
|
|
||||||
<literal>/var/lib/container/<replaceable>name</replaceable>/etc/nixos/configuration.nix</literal>,
|
<literal>/var/lib/container/<replaceable>name</replaceable>/etc/nixos/configuration.nix</literal>,
|
||||||
and run
|
and run
|
||||||
<screen>
|
<screen>
|
||||||
@ -89,6 +88,15 @@ Linux foo 3.4.82 #1-NixOS SMP Thu Mar 20 14:44:05 UTC 2014 x86_64 GNU/Linux
|
|||||||
<xref linkend="opt-networking.firewall.allowedTCPPorts"/> = [ 80 ];
|
<xref linkend="opt-networking.firewall.allowedTCPPorts"/> = [ 80 ];
|
||||||
'
|
'
|
||||||
|
|
||||||
|
<para>
|
||||||
|
Note that in previous versions of NixOS (17.09 and earlier) one could
|
||||||
|
also use all nix-related commands (like <command>nixos-rebuild switch</command>)
|
||||||
|
from inside the container. However, since the release of Nix 2.0 this
|
||||||
|
is not supported anymore. Supporting Nix commands inside the
|
||||||
|
container might be possible again in future versions. See
|
||||||
|
<link xlink:ref="https://github.com/NixOS/nixpkgs/issues/40355">the github issue</link> for tracking progress on this issue.
|
||||||
|
</para>
|
||||||
|
|
||||||
# curl http://$(nixos-container show-ip foo)/
|
# curl http://$(nixos-container show-ip foo)/
|
||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">…
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">…
|
||||||
</screen>
|
</screen>
|
||||||
@ -96,14 +104,6 @@ Linux foo 3.4.82 #1-NixOS SMP Thu Mar 20 14:44:05 UTC 2014 x86_64 GNU/Linux
|
|||||||
<filename>/etc/nixos/configuration.nix</filename>.
|
<filename>/etc/nixos/configuration.nix</filename>.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
|
||||||
Alternatively, you can change the configuration from within the container
|
|
||||||
itself by running <command>nixos-rebuild switch</command> inside the
|
|
||||||
container. Note that the container by default does not have a copy of the
|
|
||||||
NixOS channel, so you should run <command>nix-channel --update</command>
|
|
||||||
first.
|
|
||||||
</para>
|
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Containers can be stopped and started using <literal>nixos-container
|
Containers can be stopped and started using <literal>nixos-container
|
||||||
stop</literal> and <literal>nixos-container start</literal>, respectively, or
|
stop</literal> and <literal>nixos-container start</literal>, respectively, or
|
||||||
|
Loading…
x
Reference in New Issue
Block a user