summary refs log tree commit diff
path: root/nixos/doc
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2013-11-18 13:18:58 +0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2013-11-18 18:04:16 +0100
commit08a85c2152192f231dccea4d7a3c26dd894d9812 (patch)
treee4793f8a5acb066a1a00766ff01dd92edd275d98 /nixos/doc
parent174f5813ef39ead3e42e70003242baadde92156a (diff)
downloadnixpkgs-08a85c2152192f231dccea4d7a3c26dd894d9812.tar
nixpkgs-08a85c2152192f231dccea4d7a3c26dd894d9812.tar.gz
nixpkgs-08a85c2152192f231dccea4d7a3c26dd894d9812.tar.bz2
nixpkgs-08a85c2152192f231dccea4d7a3c26dd894d9812.tar.lz
nixpkgs-08a85c2152192f231dccea4d7a3c26dd894d9812.tar.xz
nixpkgs-08a85c2152192f231dccea4d7a3c26dd894d9812.tar.zst
nixpkgs-08a85c2152192f231dccea4d7a3c26dd894d9812.zip
Allow building/testing individual systemd units
Diffstat (limited to 'nixos/doc')
-rw-r--r--nixos/doc/manual/development.xml31
1 files changed, 31 insertions, 0 deletions
diff --git a/nixos/doc/manual/development.xml b/nixos/doc/manual/development.xml
index 6bbccac6e5c..cbf7ff8902f 100644
--- a/nixos/doc/manual/development.xml
+++ b/nixos/doc/manual/development.xml
@@ -652,6 +652,37 @@ $ qemu-system-x86_64 -kernel ./kernel/bzImage -initrd ./initrd/initrd -hda /dev/
     </listitem>
   </varlistentry>
 
+  <varlistentry>
+    <term><varname>systemd.units.<replaceable>unit-name</replaceable>.unit</varname></term>
+    <listitem>
+      <para>This builds the unit with the specified name.  Note that
+      since unit names contain dots
+      (e.g. <literal>httpd.service</literal>), you need to put them
+      between quotes, like this:
+
+<screen>
+$ nix-build -A 'config.systemd.units."httpd.service".unit'
+</screen>
+
+      You can also test individual units, without rebuilding the whole
+      system, by putting them in
+      <filename>/run/systemd/system</filename>:
+
+<screen>
+$ cp $(nix-build -A 'config.systemd.units."httpd.service".unit')/httpd.service \
+    /run/systemd/system/tmp-httpd.service
+$ systemctl daemon-reload
+$ systemctl start tmp-httpd.service
+</screen>
+
+      Note that the unit must not have the same name as any unit in
+      <filename>/etc/systemd/system</filename> since those take
+      precedence over <filename>/run/systemd/system</filename>.
+      That’s why the unit is installed as
+      <filename>tmp-httpd.service</filename> here.</para>
+    </listitem>
+  </varlistentry>
+
 </variablelist>
 
 </para>