Clean up some option examples

This commit is contained in:
Eelco Dolstra 2013-10-30 16:19:07 +01:00
parent 0f8b1b1a5c
commit be5d3a59dd
8 changed files with 53 additions and 53 deletions

View File

@ -98,7 +98,8 @@ rec {
representation of derivations is very large (on the order of
megabytes) and is not actually used by the manual generator. */
scrubOptionValue = x:
if isDerivation x then { type = "derivation"; drvPath = x.name; outPath = x.name; name = x.name; }
if isDerivation x then
{ type = "derivation"; drvPath = x.name; outPath = x.name; name = x.name; }
else if isList x then map scrubOptionValue x
else if isAttrs x then mapAttrs (n: v: scrubOptionValue v) (removeAttrs x ["_args"])
else x;

View File

@ -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']">

View File

@ -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;
};
}

View File

@ -75,36 +75,36 @@ in
services.openvpn.servers = mkOption {
default = {};
example = {
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 ...";
};
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";
};
};
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

View File

@ -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

View File

@ -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

View File

@ -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>.

View File

@ -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>.
'';