2014-04-14 15:26:48 +01:00
|
|
|
|
{ config, lib }:
|
2012-08-06 16:45:59 +01:00
|
|
|
|
|
2014-04-14 15:26:48 +01:00
|
|
|
|
with lib;
|
2012-08-06 16:45:59 +01:00
|
|
|
|
|
2013-10-30 14:33:20 +00:00
|
|
|
|
let
|
|
|
|
|
|
2014-11-20 09:41:05 +00:00
|
|
|
|
boolValues = [true false "yes" "no"];
|
|
|
|
|
|
|
|
|
|
assertValueOneOf = name: values: group: attr:
|
|
|
|
|
optional (attr ? ${name} && !elem attr.${name} values)
|
|
|
|
|
"Systemd ${group} field `${name}' cannot have value `${attr.${name}}'.";
|
|
|
|
|
|
|
|
|
|
assertHasField = name: group: attr:
|
|
|
|
|
optional (!(attr ? ${name}))
|
|
|
|
|
"Systemd ${group} field `${name}' must exist.";
|
|
|
|
|
|
|
|
|
|
assertOnlyFields = fields: group: attr:
|
|
|
|
|
let badFields = filter (name: ! elem name fields) (attrNames attr); in
|
|
|
|
|
optional (badFields != [ ])
|
|
|
|
|
"Systemd ${group} has extra fields [${concatStringsSep " " badFields}].";
|
|
|
|
|
|
|
|
|
|
assertRange = name: min: max: group: attr:
|
|
|
|
|
optional (attr ? ${name} && !(min <= attr.${name} && max >= attr.${name}))
|
|
|
|
|
"Systemd ${group} field `${name}' is outside the range [${toString min},${toString max}]";
|
|
|
|
|
|
|
|
|
|
digits = map toString (range 0 9);
|
|
|
|
|
|
|
|
|
|
isByteFormat = s:
|
|
|
|
|
let
|
|
|
|
|
l = reverseList (stringToCharacters s);
|
|
|
|
|
suffix = head l;
|
|
|
|
|
nums = tail l;
|
|
|
|
|
in elem suffix (["K" "M" "G" "T"] ++ digits)
|
|
|
|
|
&& all (num: elem num digits) nums;
|
|
|
|
|
|
|
|
|
|
assertByteFormat = name: group: attr:
|
|
|
|
|
optional (attr ? ${name} && ! isByteFormat attr.${name})
|
|
|
|
|
"Systemd ${group} field `${name}' must be in byte format [0-9]+[KMGT].";
|
|
|
|
|
|
|
|
|
|
hexChars = stringToCharacters "0123456789abcdefABCDEF";
|
|
|
|
|
|
|
|
|
|
isMacAddress = s: stringLength s == 17
|
|
|
|
|
&& flip all (splitString ":" s) (bytes:
|
|
|
|
|
all (byte: elem byte hexChars) (stringToCharacters bytes)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
assertMacAddress = name: group: attr:
|
|
|
|
|
optional (attr ? ${name} && ! isMacAddress attr.${name})
|
|
|
|
|
"Systemd ${group} field `${name}' must be a valid mac address.";
|
|
|
|
|
|
|
|
|
|
checkUnitConfig = group: checks: v:
|
|
|
|
|
let errors = concatMap (c: c group v) checks; in
|
|
|
|
|
if errors == [] then true
|
|
|
|
|
else builtins.trace (concatStringsSep "\n" errors) false;
|
|
|
|
|
|
|
|
|
|
checkService = checkUnitConfig "Service" [
|
|
|
|
|
(assertValueOneOf "Type" [
|
|
|
|
|
"simple" "forking" "oneshot" "dbus" "notify" "idle"
|
|
|
|
|
])
|
|
|
|
|
(assertValueOneOf "Restart" [
|
2015-01-19 10:41:18 +00:00
|
|
|
|
"no" "on-success" "on-failure" "on-abnormal" "on-abort" "always"
|
2014-11-20 09:41:05 +00:00
|
|
|
|
])
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
checkLink = checkUnitConfig "Link" [
|
|
|
|
|
(assertOnlyFields [
|
|
|
|
|
"Description" "Alias" "MACAddressPolicy" "MACAddress" "NamePolicy" "Name"
|
|
|
|
|
"MTUBytes" "BitsPerSecond" "Duplex" "WakeOnLan"
|
|
|
|
|
])
|
|
|
|
|
(assertValueOneOf "MACAddressPolicy" ["persistent" "random"])
|
|
|
|
|
(assertMacAddress "MACAddress")
|
|
|
|
|
(assertValueOneOf "NamePolicy" [
|
|
|
|
|
"kernel" "database" "onboard" "slot" "path" "mac"
|
|
|
|
|
])
|
|
|
|
|
(assertByteFormat "MTUBytes")
|
|
|
|
|
(assertByteFormat "BitsPerSecond")
|
|
|
|
|
(assertValueOneOf "Duplex" ["half" "full"])
|
|
|
|
|
(assertValueOneOf "WakeOnLan" ["phy" "magic" "off"])
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
checkNetdev = checkUnitConfig "Netdev" [
|
|
|
|
|
(assertOnlyFields [
|
|
|
|
|
"Description" "Name" "Kind" "MTUBytes" "MACAddress"
|
|
|
|
|
])
|
|
|
|
|
(assertHasField "Name")
|
|
|
|
|
(assertHasField "Kind")
|
|
|
|
|
(assertValueOneOf "Kind" [
|
|
|
|
|
"bridge" "bond" "vlan" "macvlan" "vxlan" "ipip"
|
|
|
|
|
"gre" "sit" "vti" "veth" "tun" "tap" "dummy"
|
|
|
|
|
])
|
|
|
|
|
(assertByteFormat "MTUBytes")
|
|
|
|
|
(assertMacAddress "MACAddress")
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
checkVlan = checkUnitConfig "VLAN" [
|
|
|
|
|
(assertOnlyFields ["Id"])
|
|
|
|
|
(assertRange "Id" 0 4094)
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
checkMacvlan = checkUnitConfig "MACVLAN" [
|
|
|
|
|
(assertOnlyFields ["Mode"])
|
|
|
|
|
(assertValueOneOf "Mode" ["private" "vepa" "bridge" "passthru"])
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
checkVxlan = checkUnitConfig "VXLAN" [
|
|
|
|
|
(assertOnlyFields ["Id" "Group" "TOS" "TTL" "MacLearning"])
|
|
|
|
|
(assertRange "TTL" 0 255)
|
|
|
|
|
(assertValueOneOf "MacLearning" boolValues)
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
checkTunnel = checkUnitConfig "Tunnel" [
|
|
|
|
|
(assertOnlyFields ["Local" "Remote" "TOS" "TTL" "DiscoverPathMTU"])
|
|
|
|
|
(assertRange "TTL" 0 255)
|
|
|
|
|
(assertValueOneOf "DiscoverPathMTU" boolValues)
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
checkPeer = checkUnitConfig "Peer" [
|
|
|
|
|
(assertOnlyFields ["Name" "MACAddress"])
|
|
|
|
|
(assertMacAddress "MACAddress")
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
tunTapChecks = [
|
|
|
|
|
(assertOnlyFields ["OneQueue" "MultiQueue" "PacketInfo" "User" "Group"])
|
|
|
|
|
(assertValueOneOf "OneQueue" boolValues)
|
|
|
|
|
(assertValueOneOf "MultiQueue" boolValues)
|
|
|
|
|
(assertValueOneOf "PacketInfo" boolValues)
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
checkTun = checkUnitConfig "Tun" tunTapChecks;
|
|
|
|
|
|
|
|
|
|
checkTap = checkUnitConfig "Tap" tunTapChecks;
|
|
|
|
|
|
|
|
|
|
checkBond = checkUnitConfig "Bond" [
|
|
|
|
|
(assertOnlyFields [
|
|
|
|
|
"Mode" "TransmitHashPolicy" "LACPTransmitRate" "MIIMonitorSec"
|
|
|
|
|
"UpDelaySec" "DownDelaySec"
|
|
|
|
|
])
|
|
|
|
|
(assertValueOneOf "Mode" [
|
|
|
|
|
"balance-rr" "active-backup" "balance-xor"
|
|
|
|
|
"broadcast" "802.3ad" "balance-tlb" "balance-alb"
|
|
|
|
|
])
|
|
|
|
|
(assertValueOneOf "TransmitHashPolicy" [
|
|
|
|
|
"layer2" "layer3+4" "layer2+3" "encap2+3" "802.3ad" "encap3+4"
|
|
|
|
|
])
|
|
|
|
|
(assertValueOneOf "LACPTransmitRate" ["slow" "fast"])
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
checkNetwork = checkUnitConfig "Network" [
|
|
|
|
|
(assertOnlyFields [
|
|
|
|
|
"Description" "DHCP" "DHCPServer" "IPv4LL" "IPv4LLRoute"
|
|
|
|
|
"LLMNR" "Domains" "Bridge" "Bond"
|
|
|
|
|
])
|
|
|
|
|
(assertValueOneOf "DHCP" ["both" "none" "v4" "v6"])
|
|
|
|
|
(assertValueOneOf "DHCPServer" boolValues)
|
|
|
|
|
(assertValueOneOf "IPv4LL" boolValues)
|
|
|
|
|
(assertValueOneOf "IPv4LLRoute" boolValues)
|
|
|
|
|
(assertValueOneOf "LLMNR" boolValues)
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
checkAddress = checkUnitConfig "Address" [
|
|
|
|
|
(assertOnlyFields ["Address" "Peer" "Broadcast" "Label"])
|
|
|
|
|
(assertHasField "Address")
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
checkRoute = checkUnitConfig "Route" [
|
|
|
|
|
(assertOnlyFields ["Gateway" "Destination" "Metric"])
|
|
|
|
|
(assertHasField "Gateway")
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
checkDhcp = checkUnitConfig "DHCP" [
|
|
|
|
|
(assertOnlyFields [
|
|
|
|
|
"UseDNS" "UseMTU" "SendHostname" "UseHostname" "UseDomains" "UseRoutes"
|
|
|
|
|
"CriticalConnections" "VendorClassIdentifier" "RequestBroadcast"
|
|
|
|
|
"RouteMetric"
|
|
|
|
|
])
|
|
|
|
|
(assertValueOneOf "UseDNS" boolValues)
|
|
|
|
|
(assertValueOneOf "UseMTU" boolValues)
|
|
|
|
|
(assertValueOneOf "SendHostname" boolValues)
|
|
|
|
|
(assertValueOneOf "UseHostname" boolValues)
|
|
|
|
|
(assertValueOneOf "UseDomains" boolValues)
|
|
|
|
|
(assertValueOneOf "UseRoutes" boolValues)
|
|
|
|
|
(assertValueOneOf "CriticalConnections" boolValues)
|
|
|
|
|
(assertValueOneOf "RequestBroadcast" boolValues)
|
|
|
|
|
];
|
2013-10-30 14:33:20 +00:00
|
|
|
|
|
2013-11-18 14:45:24 +00:00
|
|
|
|
unitOption = mkOptionType {
|
|
|
|
|
name = "systemd option";
|
|
|
|
|
merge = loc: defs:
|
2013-11-18 14:51:21 +00:00
|
|
|
|
let
|
|
|
|
|
defs' = filterOverrides defs;
|
|
|
|
|
defs'' = getValues defs';
|
2013-11-18 14:45:24 +00:00
|
|
|
|
in
|
2013-11-18 14:51:21 +00:00
|
|
|
|
if isList (head defs'')
|
|
|
|
|
then concatLists defs''
|
|
|
|
|
else mergeOneOption loc defs';
|
2013-11-18 14:45:24 +00:00
|
|
|
|
};
|
|
|
|
|
|
2013-10-30 14:33:20 +00:00
|
|
|
|
in rec {
|
2012-08-06 16:45:59 +01:00
|
|
|
|
|
2014-04-17 22:35:05 +01:00
|
|
|
|
sharedOptions = {
|
2012-08-06 16:45:59 +01:00
|
|
|
|
|
2012-10-29 20:01:36 +00:00
|
|
|
|
enable = mkOption {
|
|
|
|
|
default = true;
|
2013-10-28 14:12:11 +00:00
|
|
|
|
type = types.bool;
|
2012-10-29 20:01:36 +00:00
|
|
|
|
description = ''
|
|
|
|
|
If set to false, this unit will be a symlink to
|
|
|
|
|
/dev/null. This is primarily useful to prevent specific
|
|
|
|
|
template instances (e.g. <literal>serial-getty@ttyS0</literal>)
|
|
|
|
|
from being started.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
2014-04-17 22:35:05 +01:00
|
|
|
|
requiredBy = mkOption {
|
|
|
|
|
default = [];
|
|
|
|
|
type = types.listOf types.string;
|
|
|
|
|
description = "Units that require (i.e. depend on and need to go down with) this unit.";
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
wantedBy = mkOption {
|
|
|
|
|
default = [];
|
|
|
|
|
type = types.listOf types.string;
|
|
|
|
|
description = "Units that want (i.e. depend on) this unit.";
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
concreteUnitOptions = sharedOptions // {
|
|
|
|
|
|
|
|
|
|
text = mkOption {
|
|
|
|
|
type = types.nullOr types.str;
|
|
|
|
|
default = null;
|
|
|
|
|
description = "Text of this systemd unit.";
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
unit = mkOption {
|
|
|
|
|
internal = true;
|
|
|
|
|
description = "The generated unit.";
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
commonUnitOptions = sharedOptions // {
|
|
|
|
|
|
2012-08-06 16:45:59 +01:00
|
|
|
|
description = mkOption {
|
|
|
|
|
default = "";
|
2013-10-30 10:02:04 +00:00
|
|
|
|
type = types.str;
|
2012-08-06 16:45:59 +01:00
|
|
|
|
description = "Description of this unit used in systemd messages and progress indicators.";
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
requires = mkOption {
|
|
|
|
|
default = [];
|
2013-11-18 14:48:37 +00:00
|
|
|
|
type = types.listOf types.str;
|
2012-08-06 16:45:59 +01:00
|
|
|
|
description = ''
|
|
|
|
|
Start the specified units when this unit is started, and stop
|
|
|
|
|
this unit when the specified units are stopped or fail.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
wants = mkOption {
|
|
|
|
|
default = [];
|
2013-11-18 14:48:37 +00:00
|
|
|
|
type = types.listOf types.str;
|
2012-08-06 16:45:59 +01:00
|
|
|
|
description = ''
|
|
|
|
|
Start the specified units when this unit is started.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
after = mkOption {
|
|
|
|
|
default = [];
|
2013-11-18 14:48:37 +00:00
|
|
|
|
type = types.listOf types.str;
|
2012-08-06 16:45:59 +01:00
|
|
|
|
description = ''
|
|
|
|
|
If the specified units are started at the same time as
|
|
|
|
|
this unit, delay this unit until they have started.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
before = mkOption {
|
|
|
|
|
default = [];
|
2013-11-18 14:48:37 +00:00
|
|
|
|
type = types.listOf types.str;
|
2012-08-06 16:45:59 +01:00
|
|
|
|
description = ''
|
|
|
|
|
If the specified units are started at the same time as
|
|
|
|
|
this unit, delay them until this unit has started.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
2012-10-10 21:50:41 +01:00
|
|
|
|
bindsTo = mkOption {
|
|
|
|
|
default = [];
|
2013-11-18 14:48:37 +00:00
|
|
|
|
type = types.listOf types.str;
|
2012-10-10 21:50:41 +01:00
|
|
|
|
description = ''
|
|
|
|
|
Like ‘requires’, but in addition, if the specified units
|
|
|
|
|
unexpectedly disappear, this unit will be stopped as well.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
2012-08-15 20:36:54 +01:00
|
|
|
|
partOf = mkOption {
|
|
|
|
|
default = [];
|
2013-11-18 14:48:37 +00:00
|
|
|
|
type = types.listOf types.str;
|
2012-08-15 20:36:54 +01:00
|
|
|
|
description = ''
|
|
|
|
|
If the specified units are stopped or restarted, then this
|
|
|
|
|
unit is stopped or restarted as well.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
2013-09-22 20:04:54 +01:00
|
|
|
|
conflicts = mkOption {
|
|
|
|
|
default = [];
|
2013-11-18 14:48:37 +00:00
|
|
|
|
type = types.listOf types.str;
|
2013-09-22 20:04:54 +01:00
|
|
|
|
description = ''
|
|
|
|
|
If the specified units are started, then this unit is stopped
|
|
|
|
|
and vice versa.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
2014-11-19 21:11:30 +00:00
|
|
|
|
requisite = mkOption {
|
|
|
|
|
default = [];
|
|
|
|
|
type = types.listOf types.str;
|
|
|
|
|
description = ''
|
|
|
|
|
Similar to requires. However if the units listed are not started,
|
|
|
|
|
they will not be started and the transaction will fail.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
2012-10-01 23:58:11 +01:00
|
|
|
|
unitConfig = mkOption {
|
|
|
|
|
default = {};
|
|
|
|
|
example = { RequiresMountsFor = "/data"; };
|
2013-11-18 14:45:24 +00:00
|
|
|
|
type = types.attrsOf unitOption;
|
2012-10-01 23:58:11 +01:00
|
|
|
|
description = ''
|
|
|
|
|
Each attribute in this set specifies an option in the
|
|
|
|
|
<literal>[Unit]</literal> section of the unit. See
|
|
|
|
|
<citerefentry><refentrytitle>systemd.unit</refentrytitle>
|
|
|
|
|
<manvolnum>5</manvolnum></citerefentry> for details.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
2012-10-11 22:54:43 +01:00
|
|
|
|
restartTriggers = mkOption {
|
|
|
|
|
default = [];
|
2014-03-12 17:35:50 +00:00
|
|
|
|
type = types.listOf types.unspecified;
|
2012-10-11 22:54:43 +01:00
|
|
|
|
description = ''
|
|
|
|
|
An arbitrary list of items such as derivations. If any item
|
|
|
|
|
in the list changes between reconfigurations, the service will
|
|
|
|
|
be restarted.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
2012-10-01 23:58:11 +01:00
|
|
|
|
};
|
|
|
|
|
|
2012-10-09 20:14:15 +01:00
|
|
|
|
|
2014-04-17 22:35:05 +01:00
|
|
|
|
serviceOptions = commonUnitOptions // {
|
2012-10-01 23:58:11 +01:00
|
|
|
|
|
2012-08-06 16:45:59 +01:00
|
|
|
|
environment = mkOption {
|
|
|
|
|
default = {};
|
2013-11-18 14:45:24 +00:00
|
|
|
|
type = types.attrs; # FIXME
|
2012-08-06 16:45:59 +01:00
|
|
|
|
example = { PATH = "/foo/bar/bin"; LANG = "nl_NL.UTF-8"; };
|
2013-08-10 22:07:13 +01:00
|
|
|
|
description = "Environment variables passed to the service's processes.";
|
2012-08-06 16:45:59 +01:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
path = mkOption {
|
|
|
|
|
default = [];
|
|
|
|
|
apply = ps: "${makeSearchPath "bin" ps}:${makeSearchPath "sbin" ps}";
|
|
|
|
|
description = ''
|
|
|
|
|
Packages added to the service's <envar>PATH</envar>
|
|
|
|
|
environment variable. Both the <filename>bin</filename>
|
|
|
|
|
and <filename>sbin</filename> subdirectories of each
|
|
|
|
|
package are added.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
serviceConfig = mkOption {
|
2012-10-01 21:27:42 +01:00
|
|
|
|
default = {};
|
|
|
|
|
example =
|
|
|
|
|
{ StartLimitInterval = 10;
|
|
|
|
|
RestartSec = 5;
|
|
|
|
|
};
|
2013-11-18 14:45:24 +00:00
|
|
|
|
type = types.addCheck (types.attrsOf unitOption) checkService;
|
2012-08-06 16:45:59 +01:00
|
|
|
|
description = ''
|
2012-10-01 21:27:42 +01:00
|
|
|
|
Each attribute in this set specifies an option in the
|
|
|
|
|
<literal>[Service]</literal> section of the unit. See
|
|
|
|
|
<citerefentry><refentrytitle>systemd.service</refentrytitle>
|
2012-08-06 16:45:59 +01:00
|
|
|
|
<manvolnum>5</manvolnum></citerefentry> for details.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
script = mkOption {
|
2013-11-18 14:48:37 +00:00
|
|
|
|
type = types.lines;
|
2012-08-06 16:45:59 +01:00
|
|
|
|
default = "";
|
|
|
|
|
description = "Shell commands executed as the service's main process.";
|
|
|
|
|
};
|
|
|
|
|
|
2013-02-15 02:50:41 +00:00
|
|
|
|
scriptArgs = mkOption {
|
2013-10-30 10:02:04 +00:00
|
|
|
|
type = types.str;
|
2013-02-15 02:50:41 +00:00
|
|
|
|
default = "";
|
|
|
|
|
description = "Arguments passed to the main process script.";
|
|
|
|
|
};
|
|
|
|
|
|
2012-08-06 16:45:59 +01:00
|
|
|
|
preStart = mkOption {
|
2013-11-18 14:48:37 +00:00
|
|
|
|
type = types.lines;
|
2012-08-06 16:45:59 +01:00
|
|
|
|
default = "";
|
|
|
|
|
description = ''
|
|
|
|
|
Shell commands executed before the service's main process
|
|
|
|
|
is started.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
2012-10-01 21:45:49 +01:00
|
|
|
|
postStart = mkOption {
|
2013-11-18 14:48:37 +00:00
|
|
|
|
type = types.lines;
|
2012-10-01 21:45:49 +01:00
|
|
|
|
default = "";
|
|
|
|
|
description = ''
|
|
|
|
|
Shell commands executed after the service's main process
|
|
|
|
|
is started.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
2014-09-16 04:03:20 +01:00
|
|
|
|
reload = mkOption {
|
|
|
|
|
type = types.lines;
|
|
|
|
|
default = "";
|
|
|
|
|
description = ''
|
|
|
|
|
Shell commands executed when the service's main process
|
|
|
|
|
is reloaded.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
2013-11-26 17:24:55 +00:00
|
|
|
|
preStop = mkOption {
|
|
|
|
|
type = types.lines;
|
|
|
|
|
default = "";
|
|
|
|
|
description = ''
|
|
|
|
|
Shell commands executed to stop the service.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
2012-10-10 22:55:13 +01:00
|
|
|
|
postStop = mkOption {
|
2013-11-18 14:48:37 +00:00
|
|
|
|
type = types.lines;
|
2012-10-10 22:55:13 +01:00
|
|
|
|
default = "";
|
|
|
|
|
description = ''
|
|
|
|
|
Shell commands executed after the service's main process
|
|
|
|
|
has exited.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
2012-08-17 18:14:42 +01:00
|
|
|
|
restartIfChanged = mkOption {
|
|
|
|
|
type = types.bool;
|
|
|
|
|
default = true;
|
|
|
|
|
description = ''
|
|
|
|
|
Whether the service should be restarted during a NixOS
|
|
|
|
|
configuration switch if its definition has changed.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
2014-03-17 14:02:53 +00:00
|
|
|
|
reloadIfChanged = mkOption {
|
|
|
|
|
type = types.bool;
|
|
|
|
|
default = false;
|
|
|
|
|
description = ''
|
|
|
|
|
Whether the service should be reloaded during a NixOS
|
|
|
|
|
configuration switch if its definition has changed. If
|
|
|
|
|
enabled, the value of <option>restartIfChanged</option> is
|
|
|
|
|
ignored.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
2013-01-05 00:05:25 +00:00
|
|
|
|
stopIfChanged = mkOption {
|
|
|
|
|
type = types.bool;
|
|
|
|
|
default = true;
|
|
|
|
|
description = ''
|
|
|
|
|
If set, a changed unit is restarted by calling
|
|
|
|
|
<command>systemctl stop</command> in the old configuration,
|
|
|
|
|
then <command>systemctl start</command> in the new one.
|
|
|
|
|
Otherwise, it is restarted in a single step using
|
|
|
|
|
<command>systemctl restart</command> in the new configuration.
|
|
|
|
|
The latter is less correct because it runs the
|
|
|
|
|
<literal>ExecStop</literal> commands from the new
|
|
|
|
|
configuration.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
2013-10-09 13:28:35 +01:00
|
|
|
|
startAt = mkOption {
|
2013-10-30 10:02:04 +00:00
|
|
|
|
type = types.str;
|
2013-10-09 13:28:35 +01:00
|
|
|
|
default = "";
|
|
|
|
|
example = "Sun 14:00:00";
|
|
|
|
|
description = ''
|
|
|
|
|
Automatically start this unit at the given date/time, which
|
|
|
|
|
must be in the format described in
|
|
|
|
|
<citerefentry><refentrytitle>systemd.time</refentrytitle>
|
|
|
|
|
<manvolnum>5</manvolnum></citerefentry>. This is equivalent
|
|
|
|
|
to adding a corresponding timer unit with
|
|
|
|
|
<option>OnCalendar</option> set to the value given here.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
2012-08-06 16:45:59 +01:00
|
|
|
|
};
|
|
|
|
|
|
2012-10-09 20:14:15 +01:00
|
|
|
|
|
2014-04-17 22:35:05 +01:00
|
|
|
|
socketOptions = commonUnitOptions // {
|
2012-10-09 20:14:15 +01:00
|
|
|
|
|
2013-05-14 15:07:55 +01:00
|
|
|
|
listenStreams = mkOption {
|
|
|
|
|
default = [];
|
2013-11-18 14:48:37 +00:00
|
|
|
|
type = types.listOf types.str;
|
2013-05-14 15:07:55 +01:00
|
|
|
|
example = [ "0.0.0.0:993" "/run/my-socket" ];
|
|
|
|
|
description = ''
|
|
|
|
|
For each item in this list, a <literal>ListenStream</literal>
|
|
|
|
|
option in the <literal>[Socket]</literal> section will be created.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
2012-10-09 20:14:15 +01:00
|
|
|
|
socketConfig = mkOption {
|
|
|
|
|
default = {};
|
|
|
|
|
example = { ListenStream = "/run/my-socket"; };
|
2013-11-18 14:45:24 +00:00
|
|
|
|
type = types.attrsOf unitOption;
|
2012-10-09 20:14:15 +01:00
|
|
|
|
description = ''
|
|
|
|
|
Each attribute in this set specifies an option in the
|
|
|
|
|
<literal>[Socket]</literal> section of the unit. See
|
|
|
|
|
<citerefentry><refentrytitle>systemd.socket</refentrytitle>
|
|
|
|
|
<manvolnum>5</manvolnum></citerefentry> for details.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
2013-03-02 00:03:13 +00:00
|
|
|
|
|
2014-04-17 22:35:05 +01:00
|
|
|
|
timerOptions = commonUnitOptions // {
|
2013-03-02 00:03:13 +00:00
|
|
|
|
|
|
|
|
|
timerConfig = mkOption {
|
|
|
|
|
default = {};
|
|
|
|
|
example = { OnCalendar = "Sun 14:00:00"; Unit = "foo.service"; };
|
2013-11-18 14:45:24 +00:00
|
|
|
|
type = types.attrsOf unitOption;
|
2013-03-02 00:03:13 +00:00
|
|
|
|
description = ''
|
|
|
|
|
Each attribute in this set specifies an option in the
|
|
|
|
|
<literal>[Timer]</literal> section of the unit. See
|
|
|
|
|
<citerefentry><refentrytitle>systemd.timer</refentrytitle>
|
|
|
|
|
<manvolnum>5</manvolnum></citerefentry> and
|
|
|
|
|
<citerefentry><refentrytitle>systemd.time</refentrytitle>
|
|
|
|
|
<manvolnum>5</manvolnum></citerefentry> for details.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
2014-04-17 22:35:05 +01:00
|
|
|
|
pathOptions = commonUnitOptions // {
|
2014-03-31 11:23:27 +01:00
|
|
|
|
|
|
|
|
|
pathConfig = mkOption {
|
|
|
|
|
default = {};
|
|
|
|
|
example = { PathChanged = "/some/path"; Unit = "changedpath.service"; };
|
|
|
|
|
type = types.attrsOf unitOption;
|
|
|
|
|
description = ''
|
|
|
|
|
Each attribute in this set specifies an option in the
|
|
|
|
|
<literal>[Path]</literal> section of the unit. See
|
|
|
|
|
<citerefentry><refentrytitle>systemd.path</refentrytitle>
|
|
|
|
|
<manvolnum>5</manvolnum></citerefentry> for details.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
2014-04-17 22:35:05 +01:00
|
|
|
|
mountOptions = commonUnitOptions // {
|
2012-12-28 12:29:53 +00:00
|
|
|
|
|
|
|
|
|
what = mkOption {
|
|
|
|
|
example = "/dev/sda1";
|
2013-10-30 10:02:04 +00:00
|
|
|
|
type = types.str;
|
2012-12-28 12:29:53 +00:00
|
|
|
|
description = "Absolute path of device node, file or other resource. (Mandatory)";
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
where = mkOption {
|
|
|
|
|
example = "/mnt";
|
2013-10-30 10:02:04 +00:00
|
|
|
|
type = types.str;
|
2012-12-28 12:29:53 +00:00
|
|
|
|
description = ''
|
|
|
|
|
Absolute path of a directory of the mount point.
|
|
|
|
|
Will be created if it doesn't exist. (Mandatory)
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
type = mkOption {
|
|
|
|
|
default = "";
|
|
|
|
|
example = "ext4";
|
2013-10-30 10:02:04 +00:00
|
|
|
|
type = types.str;
|
2012-12-28 12:29:53 +00:00
|
|
|
|
description = "File system type.";
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
options = mkOption {
|
|
|
|
|
default = "";
|
|
|
|
|
example = "noatime";
|
2013-10-28 15:14:15 +00:00
|
|
|
|
type = types.commas;
|
2012-12-28 12:29:53 +00:00
|
|
|
|
description = "Options used to mount the file system.";
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
mountConfig = mkOption {
|
|
|
|
|
default = {};
|
|
|
|
|
example = { DirectoryMode = "0775"; };
|
2013-11-18 14:45:24 +00:00
|
|
|
|
type = types.attrsOf unitOption;
|
2012-12-28 12:29:53 +00:00
|
|
|
|
description = ''
|
|
|
|
|
Each attribute in this set specifies an option in the
|
|
|
|
|
<literal>[Mount]</literal> section of the unit. See
|
|
|
|
|
<citerefentry><refentrytitle>systemd.mount</refentrytitle>
|
|
|
|
|
<manvolnum>5</manvolnum></citerefentry> for details.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2014-04-17 22:35:05 +01:00
|
|
|
|
automountOptions = commonUnitOptions // {
|
2013-09-23 21:56:05 +01:00
|
|
|
|
|
|
|
|
|
where = mkOption {
|
|
|
|
|
example = "/mnt";
|
2013-10-30 10:02:04 +00:00
|
|
|
|
type = types.str;
|
2013-09-23 21:56:05 +01:00
|
|
|
|
description = ''
|
|
|
|
|
Absolute path of a directory of the mount point.
|
|
|
|
|
Will be created if it doesn't exist. (Mandatory)
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
automountConfig = mkOption {
|
|
|
|
|
default = {};
|
|
|
|
|
example = { DirectoryMode = "0775"; };
|
2013-11-18 14:45:24 +00:00
|
|
|
|
type = types.attrsOf unitOption;
|
2013-09-23 21:56:05 +01:00
|
|
|
|
description = ''
|
|
|
|
|
Each attribute in this set specifies an option in the
|
|
|
|
|
<literal>[Automount]</literal> section of the unit. See
|
|
|
|
|
<citerefentry><refentrytitle>systemd.automount</refentrytitle>
|
|
|
|
|
<manvolnum>5</manvolnum></citerefentry> for details.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2014-04-17 22:35:05 +01:00
|
|
|
|
targetOptions = commonUnitOptions;
|
|
|
|
|
|
2014-11-13 21:33:55 +00:00
|
|
|
|
commonNetworkOptions = {
|
|
|
|
|
|
|
|
|
|
enable = mkOption {
|
|
|
|
|
default = true;
|
|
|
|
|
type = types.bool;
|
|
|
|
|
description = ''
|
|
|
|
|
If set to false, this unit will be a symlink to
|
|
|
|
|
/dev/null.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
matchConfig = mkOption {
|
|
|
|
|
default = {};
|
|
|
|
|
example = { Name = "eth0"; };
|
|
|
|
|
type = types.attrsOf unitOption;
|
|
|
|
|
description = ''
|
|
|
|
|
Each attribute in this set specifies an option in the
|
|
|
|
|
<literal>[Match]</literal> section of the unit. See
|
|
|
|
|
<citerefentry><refentrytitle>systemd.link</refentrytitle><manvolnum>5</manvolnum></citerefentry>
|
|
|
|
|
<citerefentry><refentrytitle>systemd.netdev</refentrytitle><manvolnum>5</manvolnum></citerefentry>
|
|
|
|
|
<citerefentry><refentrytitle>systemd.network</refentrytitle><manvolnum>5</manvolnum></citerefentry>
|
|
|
|
|
for details.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
linkOptions = commonNetworkOptions // {
|
|
|
|
|
|
|
|
|
|
linkConfig = mkOption {
|
|
|
|
|
default = {};
|
|
|
|
|
example = { MACAddress = "00:ff:ee:aa:cc:dd"; };
|
2014-11-20 09:41:05 +00:00
|
|
|
|
type = types.addCheck (types.attrsOf unitOption) checkLink;
|
2014-11-13 21:33:55 +00:00
|
|
|
|
description = ''
|
|
|
|
|
Each attribute in this set specifies an option in the
|
|
|
|
|
<literal>[Link]</literal> section of the unit. See
|
|
|
|
|
<citerefentry><refentrytitle>systemd.link</refentrytitle>
|
|
|
|
|
<manvolnum>5</manvolnum></citerefentry> for details.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
netdevOptions = commonNetworkOptions // {
|
|
|
|
|
|
|
|
|
|
netdevConfig = mkOption {
|
|
|
|
|
default = {};
|
|
|
|
|
example = { Name = "mybridge"; Kind = "bridge"; };
|
2014-11-20 09:41:05 +00:00
|
|
|
|
type = types.addCheck (types.attrsOf unitOption) checkNetdev;
|
2014-11-13 21:33:55 +00:00
|
|
|
|
description = ''
|
|
|
|
|
Each attribute in this set specifies an option in the
|
|
|
|
|
<literal>[Netdev]</literal> section of the unit. See
|
|
|
|
|
<citerefentry><refentrytitle>systemd.netdev</refentrytitle>
|
|
|
|
|
<manvolnum>5</manvolnum></citerefentry> for details.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
vlanConfig = mkOption {
|
|
|
|
|
default = {};
|
|
|
|
|
example = { Id = "4"; };
|
2014-11-20 09:41:05 +00:00
|
|
|
|
type = types.addCheck (types.attrsOf unitOption) checkVlan;
|
2014-11-13 21:33:55 +00:00
|
|
|
|
description = ''
|
|
|
|
|
Each attribute in this set specifies an option in the
|
|
|
|
|
<literal>[VLAN]</literal> section of the unit. See
|
|
|
|
|
<citerefentry><refentrytitle>systemd.netdev</refentrytitle>
|
|
|
|
|
<manvolnum>5</manvolnum></citerefentry> for details.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
macvlanConfig = mkOption {
|
|
|
|
|
default = {};
|
|
|
|
|
example = { Mode = "private"; };
|
2014-11-20 09:41:05 +00:00
|
|
|
|
type = types.addCheck (types.attrsOf unitOption) checkMacvlan;
|
2014-11-13 21:33:55 +00:00
|
|
|
|
description = ''
|
|
|
|
|
Each attribute in this set specifies an option in the
|
|
|
|
|
<literal>[MACVLAN]</literal> section of the unit. See
|
|
|
|
|
<citerefentry><refentrytitle>systemd.netdev</refentrytitle>
|
|
|
|
|
<manvolnum>5</manvolnum></citerefentry> for details.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
vxlanConfig = mkOption {
|
|
|
|
|
default = {};
|
|
|
|
|
example = { Id = "4"; };
|
2014-11-20 09:41:05 +00:00
|
|
|
|
type = types.addCheck (types.attrsOf unitOption) checkVxlan;
|
2014-11-13 21:33:55 +00:00
|
|
|
|
description = ''
|
|
|
|
|
Each attribute in this set specifies an option in the
|
|
|
|
|
<literal>[VXLAN]</literal> section of the unit. See
|
|
|
|
|
<citerefentry><refentrytitle>systemd.netdev</refentrytitle>
|
|
|
|
|
<manvolnum>5</manvolnum></citerefentry> for details.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
tunnelConfig = mkOption {
|
|
|
|
|
default = {};
|
|
|
|
|
example = { Remote = "192.168.1.1"; };
|
2014-11-20 09:41:05 +00:00
|
|
|
|
type = types.addCheck (types.attrsOf unitOption) checkTunnel;
|
2014-11-13 21:33:55 +00:00
|
|
|
|
description = ''
|
|
|
|
|
Each attribute in this set specifies an option in the
|
|
|
|
|
<literal>[Tunnel]</literal> section of the unit. See
|
|
|
|
|
<citerefentry><refentrytitle>systemd.netdev</refentrytitle>
|
|
|
|
|
<manvolnum>5</manvolnum></citerefentry> for details.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
peerConfig = mkOption {
|
|
|
|
|
default = {};
|
|
|
|
|
example = { Name = "veth2"; };
|
2014-11-20 09:41:05 +00:00
|
|
|
|
type = types.addCheck (types.attrsOf unitOption) checkPeer;
|
2014-11-13 21:33:55 +00:00
|
|
|
|
description = ''
|
|
|
|
|
Each attribute in this set specifies an option in the
|
|
|
|
|
<literal>[Peer]</literal> section of the unit. See
|
|
|
|
|
<citerefentry><refentrytitle>systemd.netdev</refentrytitle>
|
|
|
|
|
<manvolnum>5</manvolnum></citerefentry> for details.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
tunConfig = mkOption {
|
|
|
|
|
default = {};
|
|
|
|
|
example = { User = "openvpn"; };
|
2014-11-20 09:41:05 +00:00
|
|
|
|
type = types.addCheck (types.attrsOf unitOption) checkTun;
|
2014-11-13 21:33:55 +00:00
|
|
|
|
description = ''
|
|
|
|
|
Each attribute in this set specifies an option in the
|
|
|
|
|
<literal>[Tun]</literal> section of the unit. See
|
|
|
|
|
<citerefentry><refentrytitle>systemd.netdev</refentrytitle>
|
|
|
|
|
<manvolnum>5</manvolnum></citerefentry> for details.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
tapConfig = mkOption {
|
|
|
|
|
default = {};
|
|
|
|
|
example = { User = "openvpn"; };
|
2014-11-20 09:41:05 +00:00
|
|
|
|
type = types.addCheck (types.attrsOf unitOption) checkTap;
|
2014-11-13 21:33:55 +00:00
|
|
|
|
description = ''
|
|
|
|
|
Each attribute in this set specifies an option in the
|
|
|
|
|
<literal>[Tap]</literal> section of the unit. See
|
|
|
|
|
<citerefentry><refentrytitle>systemd.netdev</refentrytitle>
|
|
|
|
|
<manvolnum>5</manvolnum></citerefentry> for details.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
bondConfig = mkOption {
|
|
|
|
|
default = {};
|
|
|
|
|
example = { Mode = "802.3ad"; };
|
2014-11-20 09:41:05 +00:00
|
|
|
|
type = types.addCheck (types.attrsOf unitOption) checkBond;
|
2014-11-13 21:33:55 +00:00
|
|
|
|
description = ''
|
|
|
|
|
Each attribute in this set specifies an option in the
|
|
|
|
|
<literal>[Bond]</literal> section of the unit. See
|
|
|
|
|
<citerefentry><refentrytitle>systemd.netdev</refentrytitle>
|
|
|
|
|
<manvolnum>5</manvolnum></citerefentry> for details.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
addressOptions = {
|
|
|
|
|
|
|
|
|
|
addressConfig = mkOption {
|
|
|
|
|
default = {};
|
|
|
|
|
example = { Address = "192.168.0.100/24"; };
|
2014-11-20 09:41:05 +00:00
|
|
|
|
type = types.addCheck (types.attrsOf unitOption) checkAddress;
|
2014-11-13 21:33:55 +00:00
|
|
|
|
description = ''
|
|
|
|
|
Each attribute in this set specifies an option in the
|
|
|
|
|
<literal>[Address]</literal> section of the unit. See
|
|
|
|
|
<citerefentry><refentrytitle>systemd.network</refentrytitle>
|
|
|
|
|
<manvolnum>5</manvolnum></citerefentry> for details.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
routeOptions = {
|
|
|
|
|
|
|
|
|
|
routeConfig = mkOption {
|
|
|
|
|
default = {};
|
|
|
|
|
example = { Gateway = "192.168.0.1"; };
|
2014-11-20 09:41:05 +00:00
|
|
|
|
type = types.addCheck (types.attrsOf unitOption) checkRoute;
|
2014-11-13 21:33:55 +00:00
|
|
|
|
description = ''
|
|
|
|
|
Each attribute in this set specifies an option in the
|
|
|
|
|
<literal>[Route]</literal> section of the unit. See
|
|
|
|
|
<citerefentry><refentrytitle>systemd.network</refentrytitle>
|
|
|
|
|
<manvolnum>5</manvolnum></citerefentry> for details.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
networkOptions = commonNetworkOptions // {
|
|
|
|
|
|
|
|
|
|
networkConfig = mkOption {
|
|
|
|
|
default = {};
|
|
|
|
|
example = { Description = "My Network"; };
|
2014-11-20 09:41:05 +00:00
|
|
|
|
type = types.addCheck (types.attrsOf unitOption) checkNetwork;
|
2014-11-13 21:33:55 +00:00
|
|
|
|
description = ''
|
|
|
|
|
Each attribute in this set specifies an option in the
|
|
|
|
|
<literal>[Network]</literal> section of the unit. See
|
|
|
|
|
<citerefentry><refentrytitle>systemd.network</refentrytitle>
|
|
|
|
|
<manvolnum>5</manvolnum></citerefentry> for details.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
dhcpConfig = mkOption {
|
|
|
|
|
default = {};
|
|
|
|
|
example = { UseDNS = true; UseRoutes = true; };
|
2014-11-20 09:41:05 +00:00
|
|
|
|
type = types.addCheck (types.attrsOf unitOption) checkDhcp;
|
2014-11-13 21:33:55 +00:00
|
|
|
|
description = ''
|
|
|
|
|
Each attribute in this set specifies an option in the
|
|
|
|
|
<literal>[DHCP]</literal> section of the unit. See
|
|
|
|
|
<citerefentry><refentrytitle>systemd.network</refentrytitle>
|
|
|
|
|
<manvolnum>5</manvolnum></citerefentry> for details.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
2014-11-20 10:37:48 +00:00
|
|
|
|
name = mkOption {
|
|
|
|
|
type = types.nullOr types.str;
|
|
|
|
|
default = null;
|
|
|
|
|
description = ''
|
|
|
|
|
The name of the network interface to match against.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
DHCP = mkOption {
|
|
|
|
|
type = types.nullOr types.str;
|
|
|
|
|
default = null;
|
|
|
|
|
description = ''
|
|
|
|
|
Whether to enable DHCP on the interfaces matched.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
domains = mkOption {
|
|
|
|
|
type = types.nullOr (types.listOf types.str);
|
|
|
|
|
default = null;
|
|
|
|
|
description = ''
|
|
|
|
|
A list of domains to pass to the network config.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
2014-11-13 21:33:55 +00:00
|
|
|
|
address = mkOption {
|
|
|
|
|
default = [ ];
|
|
|
|
|
type = types.listOf types.str;
|
|
|
|
|
description = ''
|
|
|
|
|
A list of addresses to be added to the network section of the
|
|
|
|
|
unit. See <citerefentry><refentrytitle>systemd.network</refentrytitle>
|
|
|
|
|
<manvolnum>5</manvolnum></citerefentry> for details.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
gateway = mkOption {
|
|
|
|
|
default = [ ];
|
|
|
|
|
type = types.listOf types.str;
|
|
|
|
|
description = ''
|
|
|
|
|
A list of gateways to be added to the network section of the
|
|
|
|
|
unit. See <citerefentry><refentrytitle>systemd.network</refentrytitle>
|
|
|
|
|
<manvolnum>5</manvolnum></citerefentry> for details.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
dns = mkOption {
|
|
|
|
|
default = [ ];
|
|
|
|
|
type = types.listOf types.str;
|
|
|
|
|
description = ''
|
|
|
|
|
A list of dns servers to be added to the network section of the
|
|
|
|
|
unit. See <citerefentry><refentrytitle>systemd.network</refentrytitle>
|
|
|
|
|
<manvolnum>5</manvolnum></citerefentry> for details.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
ntp = mkOption {
|
|
|
|
|
default = [ ];
|
|
|
|
|
type = types.listOf types.str;
|
|
|
|
|
description = ''
|
|
|
|
|
A list of ntp servers to be added to the network section of the
|
|
|
|
|
unit. See <citerefentry><refentrytitle>systemd.network</refentrytitle>
|
|
|
|
|
<manvolnum>5</manvolnum></citerefentry> for details.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
vlan = mkOption {
|
|
|
|
|
default = [ ];
|
|
|
|
|
type = types.listOf types.str;
|
|
|
|
|
description = ''
|
|
|
|
|
A list of vlan interfaces to be added to the network section of the
|
|
|
|
|
unit. See <citerefentry><refentrytitle>systemd.network</refentrytitle>
|
|
|
|
|
<manvolnum>5</manvolnum></citerefentry> for details.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
macvlan = mkOption {
|
|
|
|
|
default = [ ];
|
|
|
|
|
type = types.listOf types.str;
|
|
|
|
|
description = ''
|
|
|
|
|
A list of macvlan interfaces to be added to the network section of the
|
|
|
|
|
unit. See <citerefentry><refentrytitle>systemd.network</refentrytitle>
|
|
|
|
|
<manvolnum>5</manvolnum></citerefentry> for details.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
vxlan = mkOption {
|
|
|
|
|
default = [ ];
|
|
|
|
|
type = types.listOf types.str;
|
|
|
|
|
description = ''
|
|
|
|
|
A list of vxlan interfaces to be added to the network section of the
|
|
|
|
|
unit. See <citerefentry><refentrytitle>systemd.network</refentrytitle>
|
|
|
|
|
<manvolnum>5</manvolnum></citerefentry> for details.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
tunnel = mkOption {
|
|
|
|
|
default = [ ];
|
|
|
|
|
type = types.listOf types.str;
|
|
|
|
|
description = ''
|
|
|
|
|
A list of tunnel interfaces to be added to the network section of the
|
|
|
|
|
unit. See <citerefentry><refentrytitle>systemd.network</refentrytitle>
|
|
|
|
|
<manvolnum>5</manvolnum></citerefentry> for details.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
addresses = mkOption {
|
|
|
|
|
default = [ ];
|
|
|
|
|
type = types.listOf types.optionSet;
|
|
|
|
|
options = [ addressOptions ];
|
|
|
|
|
description = ''
|
|
|
|
|
A list of address sections to be added to the unit. See
|
|
|
|
|
<citerefentry><refentrytitle>systemd.network</refentrytitle>
|
|
|
|
|
<manvolnum>5</manvolnum></citerefentry> for details.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
routes = mkOption {
|
|
|
|
|
default = [ ];
|
|
|
|
|
type = types.listOf types.optionSet;
|
|
|
|
|
options = [ routeOptions ];
|
|
|
|
|
description = ''
|
|
|
|
|
A list of route sections to be added to the unit. See
|
|
|
|
|
<citerefentry><refentrytitle>systemd.network</refentrytitle>
|
|
|
|
|
<manvolnum>5</manvolnum></citerefentry> for details.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
2013-02-15 02:50:41 +00:00
|
|
|
|
}
|