Skip to content

Commit

Permalink
Fix imperative container code examples
Browse files Browse the repository at this point in the history
Since some time Nixos has firewall enabled by default, so update example.
Also, remove newline escaping (it isn't needed).

Closes #25174
  • Loading branch information
danbst authored and Profpatsch committed Apr 24, 2017
1 parent d965e11 commit 84b1c0c
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions nixos/doc/manual/administration/imperative-containers.xml
Expand Up @@ -29,8 +29,10 @@ line. For instance, to create a container that has
<literal>root</literal>:

<screen>
# nixos-container create foo --config 'services.openssh.enable = true; \
users.extraUsers.root.openssh.authorizedKeys.keys = ["ssh-dss AAAAB3N…"];'
# nixos-container create foo --config '
services.openssh.enable = true;
users.extraUsers.root.openssh.authorizedKeys.keys = ["ssh-dss AAAAB3N…"];
'
</screen>

</para>
Expand Down Expand Up @@ -97,8 +99,11 @@ This will build and activate the new configuration. You can also
specify a new configuration on the command line:

<screen>
# nixos-container update foo --config 'services.httpd.enable = true; \
services.httpd.adminAddr = "foo@example.org";'
# nixos-container update foo --config '
services.httpd.enable = true;
services.httpd.adminAddr = "foo@example.org";
networking.firewall.allowedTCPPorts = [ 80 ];
'

# curl http://$(nixos-container show-ip foo)/
&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">…
Expand Down

0 comments on commit 84b1c0c

Please sign in to comment.