mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-26 04:43:09 +03:00
Clean up some option examples
This commit is contained in:
parent
0f8b1b1a5c
commit
be5d3a59dd
@ -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;
|
||||
|
@ -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']">
|
||||
|
@ -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;
|
||||
};
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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>.
|
||||
|
@ -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>.
|
||||
'';
|
||||
|
Loading…
Reference in New Issue
Block a user