about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--nixos/doc/manual/configuration/configuration.xml3
-rw-r--r--nixos/doc/manual/default.nix4
-rw-r--r--nixos/modules/services/databases/postgresql.xml77
3 files changed, 83 insertions, 1 deletions
diff --git a/nixos/doc/manual/configuration/configuration.xml b/nixos/doc/manual/configuration/configuration.xml
index e15c700017c4c..8fde0dc7e6110 100644
--- a/nixos/doc/manual/configuration/configuration.xml
+++ b/nixos/doc/manual/configuration/configuration.xml
@@ -24,6 +24,9 @@ effect after you run <command>nixos-rebuild</command>.</para>
 <xi:include href="networking.xml" />
 <xi:include href="linux-kernel.xml" />
 
+<!-- FIXME: auto-include NixOS module docs -->
+<xi:include href="postgresql.xml" />
+
 <!-- Apache; libvirtd virtualisation -->
 
 </part>
diff --git a/nixos/doc/manual/default.nix b/nixos/doc/manual/default.nix
index f5cc33919b8f1..47e01437ccc41 100644
--- a/nixos/doc/manual/default.nix
+++ b/nixos/doc/manual/default.nix
@@ -41,6 +41,8 @@ let
   copySources =
     ''
       cp -prd $sources/* . # */
+      chmod -R u+w .
+      cp ${../../modules/services/databases/postgresql.xml} configuration/postgresql.xml
       ln -s ${optionsDocBook} options-db.xml
       echo "${version}" > version
     '';
@@ -74,7 +76,7 @@ in rec {
         --param toc.section.depth 3 \
         --stringparam admon.style "" \
         --stringparam callout.graphics.extension .gif \
-        --param chunk.section.depth 1 \
+        --param chunk.section.depth 0 \
         --param chunk.first.sections 1 \
         --param use.id.as.filename 1 \
         --stringparam generate.toc "book toc chapter toc appendix toc" \
diff --git a/nixos/modules/services/databases/postgresql.xml b/nixos/modules/services/databases/postgresql.xml
new file mode 100644
index 0000000000000..e98b431bd60a2
--- /dev/null
+++ b/nixos/modules/services/databases/postgresql.xml
@@ -0,0 +1,77 @@
+<chapter xmlns="http://docbook.org/ns/docbook"
+         xmlns:xlink="http://www.w3.org/1999/xlink"
+         xmlns:xi="http://www.w3.org/2001/XInclude"
+         version="5.0"
+         xml:id="module-postgresql">
+
+<title>PostgreSQL</title>
+
+<!-- FIXME: render nicely -->
+
+<!-- FIXME: source can be added automatically -->
+<para><emphasis>Source:</emphasis> <filename>modules/services/databases/postgresql.nix</filename></para>
+
+<para><emphasis>Upstream documentation:</emphasis> <link xlink:href="http://www.postgresql.org/docs/"/></para>
+
+<!-- FIXME: more stuff, like maintainer? -->
+
+<para>PostgreSQL is an advanced, free relational database.<!-- MORE --></para>
+
+<section><title>Configuring</title>
+
+<para>To enable PostgreSQL, add the following to your
+<filename>configuration.nix</filename>:
+
+<programlisting>
+services.postgresql.enable = true;
+services.postgresql.package = pkgs.postgresql93;
+</programlisting>
+
+Note that you are required to specify the desired version of
+PostgreSQL (e.g. <literal>pkgs.postgresql93</literal>). Since
+upgrading your PostgreSQL version requires a database dump and reload
+(see below), NixOS cannot provide a default value for
+<option>services.postgresql.package</option> such as the most recent
+release of PostgreSQL.</para>
+
+<!--
+<para>After running <command>nixos-rebuild</command>, you can verify
+whether PostgreSQL works by running <command>psql</command>:
+
+<screen>
+$ psql
+psql (9.2.9)
+Type "help" for help.
+
+alice=>
+</screen>
+-->
+
+<para>By default, PostgreSQL stores its databases in
+<filename>/var/db/postgresql</filename>. You can override this using
+<option>services.postgresql.dataDir</option>, e.g.
+
+<programlisting>
+services.postgresql.dataDir = "/data/postgresql";
+</programlisting>
+
+</para>
+
+</section>
+
+
+<section><title>Upgrading</title>
+
+<para>FIXME: document dump/upgrade/load cycle.</para>
+
+</section>
+
+
+<section><title>Options</title>
+
+<para>FIXME: auto-generated list of module options.</para>
+
+</section>
+
+
+</chapter>