mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-10 03:23:29 +03:00
Clean up some option examples
This commit is contained in:
parent
0f8b1b1a5c
commit
be5d3a59dd
8 changed files with 53 additions and 53 deletions
|
@ -98,7 +98,8 @@ rec {
|
||||||
representation of derivations is very large (on the order of
|
representation of derivations is very large (on the order of
|
||||||
megabytes) and is not actually used by the manual generator. */
|
megabytes) and is not actually used by the manual generator. */
|
||||||
scrubOptionValue = x:
|
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 isList x then map scrubOptionValue x
|
||||||
else if isAttrs x then mapAttrs (n: v: scrubOptionValue v) (removeAttrs x ["_args"])
|
else if isAttrs x then mapAttrs (n: v: scrubOptionValue v) (removeAttrs x ["_args"])
|
||||||
else x;
|
else x;
|
||||||
|
|
|
@ -157,14 +157,7 @@
|
||||||
|
|
||||||
|
|
||||||
<xsl:template match="derivation">
|
<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>
|
<replaceable>(build of <xsl:value-of select="attr[@name = 'name']/string/@value" />)</replaceable>
|
||||||
</xsl:otherwise>
|
|
||||||
</xsl:choose>
|
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template match="attr[@name = 'declarations' or @name = 'definitions']">
|
<xsl:template match="attr[@name = 'declarations' or @name = 'definitions']">
|
||||||
|
|
|
@ -59,7 +59,7 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
nixpkgs.system = mkOption {
|
nixpkgs.system = mkOption {
|
||||||
default = pkgs.stdenv.system;
|
type = types.str;
|
||||||
description = ''
|
description = ''
|
||||||
Specifies the Nix platform type for which NixOS should be built.
|
Specifies the Nix platform type for which NixOS should be built.
|
||||||
If unset, it defaults to the platform type of your host system
|
If unset, it defaults to the platform type of your host system
|
||||||
|
@ -70,4 +70,8 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
nixpkgs.system = pkgs.stdenv.system;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,22 +75,22 @@ in
|
||||||
services.openvpn.servers = mkOption {
|
services.openvpn.servers = mkOption {
|
||||||
default = {};
|
default = {};
|
||||||
|
|
||||||
example = {
|
example = literalExample ''
|
||||||
|
{
|
||||||
server = {
|
server = {
|
||||||
config = ''
|
config = '''
|
||||||
# Simplest server configuration: http://openvpn.net/index.php/documentation/miscellaneous/static-key-mini-howto.html.
|
# Simplest server configuration: http://openvpn.net/index.php/documentation/miscellaneous/static-key-mini-howto.html.
|
||||||
# server :
|
# server :
|
||||||
dev tun
|
dev tun
|
||||||
ifconfig 10.8.0.1 10.8.0.2
|
ifconfig 10.8.0.1 10.8.0.2
|
||||||
secret /root/static.key
|
secret /root/static.key
|
||||||
'';
|
''';
|
||||||
up = "ip route add ...";
|
up = "ip route add ...";
|
||||||
down = "ip route del ...";
|
down = "ip route del ...";
|
||||||
};
|
};
|
||||||
|
|
||||||
client = {
|
client = {
|
||||||
config = ''
|
config = '''
|
||||||
client
|
client
|
||||||
remote vpn.example.org
|
remote vpn.example.org
|
||||||
dev tun
|
dev tun
|
||||||
|
@ -99,12 +99,12 @@ in
|
||||||
ca /root/.vpn/ca.crt
|
ca /root/.vpn/ca.crt
|
||||||
cert /root/.vpn/alice.crt
|
cert /root/.vpn/alice.crt
|
||||||
key /root/.vpn/alice.key
|
key /root/.vpn/alice.key
|
||||||
|
''';
|
||||||
|
up = "echo nameserver $nameserver | ''${pkgs.openresolv}/sbin/resolvconf -m 0 -a $dev";
|
||||||
|
down = "''${pkgs.openresolv}/sbin/resolvconf -d $dev";
|
||||||
|
};
|
||||||
|
}
|
||||||
'';
|
'';
|
||||||
up = "echo nameserver $nameserver | ${pkgs.openresolv}/sbin/resolvconf -m 0 -a $dev";
|
|
||||||
down = "${pkgs.openresolv}/sbin/resolvconf -d $dev";
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
description = ''
|
description = ''
|
||||||
Each attribute of this option defines an Upstart job to run an
|
Each attribute of this option defines an Upstart job to run an
|
||||||
|
|
|
@ -445,7 +445,7 @@ in
|
||||||
extraModules = mkOption {
|
extraModules = mkOption {
|
||||||
type = types.listOf types.unspecified;
|
type = types.listOf types.unspecified;
|
||||||
default = [];
|
default = [];
|
||||||
example = [ "proxy_connect" { name = "php5"; path = "${php}/modules/libphp5.so"; } ];
|
example = literalExample ''[ "proxy_connect" { name = "php5"; path = "''${php}/modules/libphp5.so"; } ]'';
|
||||||
description = ''
|
description = ''
|
||||||
Additional Apache modules to be used. These can be
|
Additional Apache modules to be used. These can be
|
||||||
specified as a string in the case of modules distributed
|
specified as a string in the case of modules distributed
|
||||||
|
|
|
@ -204,16 +204,17 @@ in
|
||||||
|
|
||||||
session = mkOption {
|
session = mkOption {
|
||||||
default = [];
|
default = [];
|
||||||
example = [
|
example = literalExample
|
||||||
{
|
''
|
||||||
manage = "desktop";
|
[ { manage = "desktop";
|
||||||
name = "xterm";
|
name = "xterm";
|
||||||
start = "
|
start = '''
|
||||||
${pkgs.xterm}/bin/xterm -ls &
|
''${pkgs.xterm}/bin/xterm -ls &
|
||||||
waitPID=$!
|
waitPID=$!
|
||||||
";
|
''';
|
||||||
}
|
}
|
||||||
];
|
]
|
||||||
|
'';
|
||||||
description = ''
|
description = ''
|
||||||
List of sessions supported with the command used to start each
|
List of sessions supported with the command used to start each
|
||||||
session. Each session script can set the
|
session. Each session script can set the
|
||||||
|
|
|
@ -156,7 +156,7 @@ in
|
||||||
extraFiles = mkOption {
|
extraFiles = mkOption {
|
||||||
default = {};
|
default = {};
|
||||||
example = literalExample ''
|
example = literalExample ''
|
||||||
{ "memtest.bin" = "${pkgs.memtest86plus}/memtest.bin"; }
|
{ "memtest.bin" = "''${pkgs.memtest86plus}/memtest.bin"; }
|
||||||
'';
|
'';
|
||||||
description = ''
|
description = ''
|
||||||
A set of files to be copied to <filename>/boot</filename>.
|
A set of files to be copied to <filename>/boot</filename>.
|
||||||
|
|
|
@ -32,13 +32,14 @@ in
|
||||||
environment.etc = mkOption {
|
environment.etc = mkOption {
|
||||||
type = types.loaOf types.optionSet;
|
type = types.loaOf types.optionSet;
|
||||||
default = {};
|
default = {};
|
||||||
example =
|
example = literalExample ''
|
||||||
{ hosts =
|
{ hosts =
|
||||||
{ source = "/nix/store/.../etc/dir/file.conf.example";
|
{ source = "/nix/store/.../etc/dir/file.conf.example";
|
||||||
mode = "0440";
|
mode = "0440";
|
||||||
};
|
};
|
||||||
"default/useradd".text = "GROUP=100 ...";
|
"default/useradd".text = "GROUP=100 ...";
|
||||||
};
|
}
|
||||||
|
'';
|
||||||
description = ''
|
description = ''
|
||||||
Set of files that have to be linked in <filename>/etc</filename>.
|
Set of files that have to be linked in <filename>/etc</filename>.
|
||||||
'';
|
'';
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue