about summary refs log tree commit diff
path: root/nixos/doc/manual/installation
diff options
context:
space:
mode:
authorChristian Kögler <ck3d@gmx.de>2019-08-24 08:49:44 +0200
committerFranz Pletz <fpletz@fnordicwalking.de>2019-09-13 17:33:38 +0200
commitba37b3c622da535a5b06ae5d05e37146b6f4143f (patch)
tree50f7d2f366553210d139d86d9a439a404505ab25 /nixos/doc/manual/installation
parent930ac600d2b3f18fcfd41c387835332cfb480462 (diff)
downloadnixlib-ba37b3c622da535a5b06ae5d05e37146b6f4143f.tar
nixlib-ba37b3c622da535a5b06ae5d05e37146b6f4143f.tar.gz
nixlib-ba37b3c622da535a5b06ae5d05e37146b6f4143f.tar.bz2
nixlib-ba37b3c622da535a5b06ae5d05e37146b6f4143f.tar.lz
nixlib-ba37b3c622da535a5b06ae5d05e37146b6f4143f.tar.xz
nixlib-ba37b3c622da535a5b06ae5d05e37146b6f4143f.tar.zst
nixlib-ba37b3c622da535a5b06ae5d05e37146b6f4143f.zip
nixos: added installation doc for nspawn container
Diffstat (limited to 'nixos/doc/manual/installation')
-rw-r--r--nixos/doc/manual/installation/installing-nspawn-container.xml37
-rw-r--r--nixos/doc/manual/installation/installing.xml3
2 files changed, 40 insertions, 0 deletions
diff --git a/nixos/doc/manual/installation/installing-nspawn-container.xml b/nixos/doc/manual/installation/installing-nspawn-container.xml
new file mode 100644
index 000000000000..ae893c53c905
--- /dev/null
+++ b/nixos/doc/manual/installation/installing-nspawn-container.xml
@@ -0,0 +1,37 @@
+<section xmlns="http://docbook.org/ns/docbook"
+         version="5.0"
+         xml:id="sec-installing-nspawn-container">
+ <title>Installing into a nspawn container</title>
+
+ <para>
+  For installing a NixOS into a systemd nspawn container the NixOS installation tools are needed.
+  If you run another distribution than NixOS on your host,
+  please follow <xref linkend="sec-installing-from-other-distro"/> steps 1, 2, and 3.
+ </para>
+
+ <para>
+  Create a NixOS configuration file <filename>/var/lib/machines/my-container/etc/nixos/configuration.nix</filename>.
+  It is important that the container root file system is under <filename>/var/lib/machines</filename>.
+  This is the standard location where <command>machinectl</command> will look for containers.
+  If you choose place the root into another location you need to start the container directly with <command>systemd-nspawn</command>.
+  The file needs to have at least following options enabled:
+<programlisting>
+<xref linkend="opt-boot.isContainer"/> = true;
+<xref linkend="opt-boot.loader.initScript.enable"/> = true;
+</programlisting>
+  If your host uses <command>systemd-networkd</command> to configure the network,
+  you can also enable <xref linkend="opt-networking.useNetworkd"/> to use networkd default network configuration for your host and container.
+ </para>
+
+ <para>
+  Install the container by running following command:
+   <screen>nixos-install --root /var/lib/machines/my-container \
+     --no-channel-copy --no-root-passwd --no-bootloader</screen>
+ </para>
+
+ <para>
+  Start the container by running following command:
+  <screen>machinectl start my-container</screen>
+ </para>
+
+</section>
diff --git a/nixos/doc/manual/installation/installing.xml b/nixos/doc/manual/installation/installing.xml
index f1e1568c0349..270372022fac 100644
--- a/nixos/doc/manual/installation/installing.xml
+++ b/nixos/doc/manual/installation/installing.xml
@@ -563,5 +563,8 @@ Retype new UNIX password: ***</screen>
   <xi:include href="installing-from-other-distro.xml" />
 
   <xi:include href="installing-behind-a-proxy.xml" />
+
+  <xi:include href="installing-nspawn-container.xml" />
+
  </section>
 </chapter>