summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2013-10-30 16:19:07 +0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2013-10-30 18:47:43 +0100
commitbe5d3a59dd3684ffabf456728938ed0f6f3df59c (patch)
tree89c508fe9c473c39290ead110b70e89a1d88d61d /nixos
parent0f8b1b1a5c52a8171d9028e1df74949aea264c72 (diff)
downloadnixpkgs-be5d3a59dd3684ffabf456728938ed0f6f3df59c.tar
nixpkgs-be5d3a59dd3684ffabf456728938ed0f6f3df59c.tar.gz
nixpkgs-be5d3a59dd3684ffabf456728938ed0f6f3df59c.tar.bz2
nixpkgs-be5d3a59dd3684ffabf456728938ed0f6f3df59c.tar.lz
nixpkgs-be5d3a59dd3684ffabf456728938ed0f6f3df59c.tar.xz
nixpkgs-be5d3a59dd3684ffabf456728938ed0f6f3df59c.tar.zst
nixpkgs-be5d3a59dd3684ffabf456728938ed0f6f3df59c.zip
Clean up some option examples
Diffstat (limited to 'nixos')
-rw-r--r--nixos/doc/manual/options-to-docbook.xsl9
-rw-r--r--nixos/modules/misc/nixpkgs.nix6
-rw-r--r--nixos/modules/services/networking/openvpn.nix60
-rw-r--r--nixos/modules/services/web-servers/apache-httpd/default.nix2
-rw-r--r--nixos/modules/services/x11/display-managers/default.nix21
-rw-r--r--nixos/modules/system/boot/loader/grub/grub.nix2
-rw-r--r--nixos/modules/system/etc/etc.nix5
7 files changed, 52 insertions, 53 deletions
diff --git a/nixos/doc/manual/options-to-docbook.xsl b/nixos/doc/manual/options-to-docbook.xsl
index f4bdc6288b1..6d11ad7a6c4 100644
--- a/nixos/doc/manual/options-to-docbook.xsl
+++ b/nixos/doc/manual/options-to-docbook.xsl
@@ -157,14 +157,7 @@
 
 
   <xsl:template match="derivation">
-    <xsl:choose>
-      <xsl:when test="attr[@name = 'url']/string/@value">
-        <replaceable>(download of <xsl:value-of select="attr[@name = 'url']/string/@value" />)</replaceable>
-      </xsl:when>
-      <xsl:otherwise>
-        <replaceable>(build of <xsl:value-of select="attr[@name = 'name']/string/@value" />)</replaceable>
-      </xsl:otherwise>
-    </xsl:choose>
+    <replaceable>(build of <xsl:value-of select="attr[@name = 'name']/string/@value" />)</replaceable>
   </xsl:template>
 
   <xsl:template match="attr[@name = 'declarations' or @name = 'definitions']">
diff --git a/nixos/modules/misc/nixpkgs.nix b/nixos/modules/misc/nixpkgs.nix
index 239da2859e9..1d9b89a0b0f 100644
--- a/nixos/modules/misc/nixpkgs.nix
+++ b/nixos/modules/misc/nixpkgs.nix
@@ -59,7 +59,7 @@ in
     };
 
     nixpkgs.system = mkOption {
-      default = pkgs.stdenv.system;
+      type = types.str;
       description = ''
         Specifies the Nix platform type for which NixOS should be built.
         If unset, it defaults to the platform type of your host system
@@ -70,4 +70,8 @@ in
     };
 
   };
+
+  config = {
+    nixpkgs.system = pkgs.stdenv.system;
+  };
 }
diff --git a/nixos/modules/services/networking/openvpn.nix b/nixos/modules/services/networking/openvpn.nix
index 8cc19506e21..400cb74f7d9 100644
--- a/nixos/modules/services/networking/openvpn.nix
+++ b/nixos/modules/services/networking/openvpn.nix
@@ -75,36 +75,36 @@ in
     services.openvpn.servers = mkOption {
       default = {};
 
-      example = {
-
-        server = {
-          config = ''
-            # Simplest server configuration: http://openvpn.net/index.php/documentation/miscellaneous/static-key-mini-howto.html.
-            # server :
-            dev tun
-            ifconfig 10.8.0.1 10.8.0.2
-            secret /root/static.key
-          '';
-          up = "ip route add ...";
-          down = "ip route del ...";
-        };
-
-        client = {
-          config = ''
-            client
-            remote vpn.example.org
-            dev tun
-            proto tcp-client
-            port 8080
-            ca /root/.vpn/ca.crt
-            cert /root/.vpn/alice.crt
-            key /root/.vpn/alice.key
-          '';
-          up = "echo nameserver $nameserver | ${pkgs.openresolv}/sbin/resolvconf -m 0 -a $dev";
-          down = "${pkgs.openresolv}/sbin/resolvconf -d $dev";
-        };
-
-      };
+      example = literalExample ''
+        {
+          server = {
+            config = '''
+              # Simplest server configuration: http://openvpn.net/index.php/documentation/miscellaneous/static-key-mini-howto.html.
+              # server :
+              dev tun
+              ifconfig 10.8.0.1 10.8.0.2
+              secret /root/static.key
+            ''';
+            up = "ip route add ...";
+            down = "ip route del ...";
+          };
+
+          client = {
+            config = '''
+              client
+              remote vpn.example.org
+              dev tun
+              proto tcp-client
+              port 8080
+              ca /root/.vpn/ca.crt
+              cert /root/.vpn/alice.crt
+              key /root/.vpn/alice.key
+            ''';
+            up = "echo nameserver $nameserver | ''${pkgs.openresolv}/sbin/resolvconf -m 0 -a $dev";
+            down = "''${pkgs.openresolv}/sbin/resolvconf -d $dev";
+          };
+        }
+      '';
 
       description = ''
         Each attribute of this option defines an Upstart job to run an
diff --git a/nixos/modules/services/web-servers/apache-httpd/default.nix b/nixos/modules/services/web-servers/apache-httpd/default.nix
index e9cf9ae5e3e..d21b6da0e77 100644
--- a/nixos/modules/services/web-servers/apache-httpd/default.nix
+++ b/nixos/modules/services/web-servers/apache-httpd/default.nix
@@ -445,7 +445,7 @@ in
       extraModules = mkOption {
         type = types.listOf types.unspecified;
         default = [];
-        example = [ "proxy_connect" { name = "php5"; path = "${php}/modules/libphp5.so"; } ];
+        example = literalExample ''[ "proxy_connect" { name = "php5"; path = "''${php}/modules/libphp5.so"; } ]'';
         description = ''
           Additional Apache modules to be used.  These can be
           specified as a string in the case of modules distributed
diff --git a/nixos/modules/services/x11/display-managers/default.nix b/nixos/modules/services/x11/display-managers/default.nix
index 65b634f9482..0910708002b 100644
--- a/nixos/modules/services/x11/display-managers/default.nix
+++ b/nixos/modules/services/x11/display-managers/default.nix
@@ -204,16 +204,17 @@ in
 
       session = mkOption {
         default = [];
-        example = [
-          {
-            manage = "desktop";
-            name = "xterm";
-            start = "
-              ${pkgs.xterm}/bin/xterm -ls &
-              waitPID=$!
-            ";
-          }
-        ];
+        example = literalExample
+          ''
+            [ { manage = "desktop";
+                name = "xterm";
+                start = '''
+                  ''${pkgs.xterm}/bin/xterm -ls &
+                  waitPID=$!
+                ''';
+              }
+            ]
+          '';
         description = ''
           List of sessions supported with the command used to start each
           session.  Each session script can set the
diff --git a/nixos/modules/system/boot/loader/grub/grub.nix b/nixos/modules/system/boot/loader/grub/grub.nix
index e18a1d4c112..56cb7cbeaa6 100644
--- a/nixos/modules/system/boot/loader/grub/grub.nix
+++ b/nixos/modules/system/boot/loader/grub/grub.nix
@@ -156,7 +156,7 @@ in
       extraFiles = mkOption {
         default = {};
         example = literalExample ''
-          { "memtest.bin" = "${pkgs.memtest86plus}/memtest.bin"; }
+          { "memtest.bin" = "''${pkgs.memtest86plus}/memtest.bin"; }
         '';
         description = ''
           A set of files to be copied to <filename>/boot</filename>.
diff --git a/nixos/modules/system/etc/etc.nix b/nixos/modules/system/etc/etc.nix
index 30d0119c293..b22259b6d63 100644
--- a/nixos/modules/system/etc/etc.nix
+++ b/nixos/modules/system/etc/etc.nix
@@ -32,13 +32,14 @@ in
     environment.etc = mkOption {
       type = types.loaOf types.optionSet;
       default = {};
-      example =
+      example = literalExample ''
         { hosts =
             { source = "/nix/store/.../etc/dir/file.conf.example";
               mode = "0440";
             };
           "default/useradd".text = "GROUP=100 ...";
-        };
+        }
+      '';
       description = ''
         Set of files that have to be linked in <filename>/etc</filename>.
       '';