mirror of
https://github.com/nix-community/home-manager
synced 2025-01-26 10:55:02 +01:00
commit
cf662b6c98
3 changed files with 53 additions and 20 deletions
|
@ -1,7 +1,7 @@
|
||||||
# launchd option type from nix-darwin
|
# launchd option type from nix-darwin
|
||||||
#
|
#
|
||||||
# Original Source:
|
# Original Source:
|
||||||
# https://github.com/LnL7/nix-darwin/blob/a34dea2/modules/launchd/launchd.nix
|
# https://github.com/LnL7/nix-darwin/blob/14a12e9/modules/launchd/launchd.nix
|
||||||
|
|
||||||
# Copyright 2017 Daiderd Jordan
|
# Copyright 2017 Daiderd Jordan
|
||||||
#
|
#
|
||||||
|
@ -28,6 +28,8 @@
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
{
|
{
|
||||||
|
freeformType = with types; attrsOf anything; # added by Home Manager
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
Label = mkOption {
|
Label = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
|
@ -101,8 +103,8 @@ with lib;
|
||||||
type = types.nullOr (types.listOf types.str);
|
type = types.nullOr (types.listOf types.str);
|
||||||
default = null;
|
default = null;
|
||||||
description = ''
|
description = ''
|
||||||
This configuration file only applies to the hosts listed with this key. Note: One should set kern.host-name kern.hostname
|
This configuration file only applies to the hosts listed with this key. Note: One should set kern.hostname
|
||||||
name in <literal>sysctl.conf(5)</literal> for this feature to work reliably.
|
in <literal>sysctl.conf(5)</literal> for this feature to work reliably.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -110,8 +112,8 @@ with lib;
|
||||||
type = types.nullOr (types.listOf types.str);
|
type = types.nullOr (types.listOf types.str);
|
||||||
default = null;
|
default = null;
|
||||||
description = ''
|
description = ''
|
||||||
This configuration file only applies to hosts NOT listed with this key. Note: One should set kern.host-name kern.hostname
|
This configuration file only applies to hosts NOT listed with this key. Note: One should set kern.hostname
|
||||||
name in <literal>sysctl.conf(5)</literal> for this feature to work reliably.
|
in <literal>sysctl.conf(5)</literal> for this feature to work reliably.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -218,17 +220,21 @@ with lib;
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
# NOTE: this was missing in the original source at the time of writing
|
|
||||||
Crashed = mkOption {
|
Crashed = mkOption {
|
||||||
type = types.nullOr types.bool;
|
type = types.nullOr types.bool;
|
||||||
default = null;
|
default = null;
|
||||||
description = ''
|
description = ''
|
||||||
If true, the the job will be restarted as long as it exited due to a signal which is typically
|
If true, the the job will be restarted as long as it exited due to a signal which is typically
|
||||||
associated with a crash (SIGILL, SIGSEGV, etc.). If false, the job will be restarted in the inverse
|
associated with a crash (SIGILL, SIGSEGV, etc.). If false, the job will be restarted in the
|
||||||
condition.
|
inverse condition.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
AfterInitialDemand = mkOption {
|
||||||
|
type = types.nullOr types.bool;
|
||||||
|
default = null;
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
}));
|
}));
|
||||||
default = null;
|
default = null;
|
||||||
|
@ -240,7 +246,7 @@ with lib;
|
||||||
multiple keys are provided, launchd ORs them, thus providing maximum flexibility to the job to refine
|
multiple keys are provided, launchd ORs them, thus providing maximum flexibility to the job to refine
|
||||||
the logic and stall if necessary. If launchd finds no reason to restart the job, it falls back on
|
the logic and stall if necessary. If launchd finds no reason to restart the job, it falls back on
|
||||||
demand based invocation. Jobs that exit quickly and frequently when configured to be kept alive will
|
demand based invocation. Jobs that exit quickly and frequently when configured to be kept alive will
|
||||||
be throttled to conserve system resources.
|
be throttled to converve system resources.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -516,8 +522,8 @@ with lib;
|
||||||
default = null;
|
default = null;
|
||||||
description = ''
|
description = ''
|
||||||
The maximum number of open files for this process. Setting this value in a system wide daemon
|
The maximum number of open files for this process. Setting this value in a system wide daemon
|
||||||
will set the <literal>sysctl(3)</literal> kern.maxfiles (SoftResourceLimits) or kern.maxfilesperproc (HardResource-Limits) (HardResourceLimits)
|
will set the <literal>sysctl(3)</literal> kern.maxfiles (SoftResourceLimits) or kern.maxfilesperproc (HardResourceLimits)
|
||||||
Limits) value in addition to the <literal>setrlimit(2)</literal> values.
|
value in addition to the <literal>setrlimit(2)</literal> values.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -608,8 +614,8 @@ with lib;
|
||||||
default = null;
|
default = null;
|
||||||
description = ''
|
description = ''
|
||||||
The maximum number of open files for this process. Setting this value in a system wide daemon
|
The maximum number of open files for this process. Setting this value in a system wide daemon
|
||||||
will set the <literal>sysctl(3)</literal> kern.maxfiles (SoftResourceLimits) or kern.maxfilesperproc (HardResource-Limits) (HardResourceLimits)
|
will set the <literal>sysctl(3)</literal> kern.maxfiles (SoftResourceLimits) or kern.maxfilesperproc (HardResourceLimits)
|
||||||
Limits) value in addition to the <literal>setrlimit(2)</literal> values.
|
value in addition to the <literal>setrlimit(2)</literal> values.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -728,8 +734,8 @@ with lib;
|
||||||
description = ''
|
description = ''
|
||||||
If this boolean is false, the port is recycled, thus leaving clients to remain oblivious to the
|
If this boolean is false, the port is recycled, thus leaving clients to remain oblivious to the
|
||||||
demand nature of job. If the value is set to true, clients receive port death notifications when
|
demand nature of job. If the value is set to true, clients receive port death notifications when
|
||||||
the job lets go of the receive right. The port will be recreated atomically with respect to boot-strap_look_up() bootstrap_look_up()
|
the job lets go of the receive right. The port will be recreated atomically with respect to bootstrap_look_up()
|
||||||
strap_look_up() calls, so that clients can trust that after receiving a port death notification,
|
calls, so that clients can trust that after receiving a port death notification,
|
||||||
the new port will have already been recreated. Setting the value to true should be done with
|
the new port will have already been recreated. Setting the value to true should be done with
|
||||||
care. Not all clients may be able to handle this behavior. The default value is false.
|
care. Not all clients may be able to handle this behavior. The default value is false.
|
||||||
'';
|
'';
|
||||||
|
@ -747,6 +753,31 @@ with lib;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
LaunchEvents = mkOption {
|
||||||
|
type = types.nullOr (types.attrs);
|
||||||
|
default = null;
|
||||||
|
description = ''
|
||||||
|
Specifies higher-level event types to be used as launch-on-demand event
|
||||||
|
sources. Each sub-dictionary defines events for a particular event
|
||||||
|
subsystem, such as "com.apple.iokit.matching", which can be used to
|
||||||
|
launch jobs based on the appearance of nodes in the IORegistry. Each
|
||||||
|
dictionary within the sub-dictionary specifies an event descriptor that
|
||||||
|
is specified to each event subsystem. With this key, the job promises to
|
||||||
|
use the xpc_set_event_stream_handler(3) API to consume events. See
|
||||||
|
xpc_events(3) for more details on event sources.
|
||||||
|
'';
|
||||||
|
example = {
|
||||||
|
"com.apple.iokit.matching" = {
|
||||||
|
"com.apple.usb.device" = {
|
||||||
|
IOMatchLaunchStream = true;
|
||||||
|
IOProviderClass = "IOUSBDevice";
|
||||||
|
idProduct = "*";
|
||||||
|
idVendor = "*";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
Sockets = mkOption {
|
Sockets = mkOption {
|
||||||
default = null;
|
default = null;
|
||||||
description = ''
|
description = ''
|
||||||
|
@ -848,8 +879,7 @@ with lib;
|
||||||
default = null;
|
default = null;
|
||||||
description = ''
|
description = ''
|
||||||
This optional key can be used to request that the service be registered with the
|
This optional key can be used to request that the service be registered with the
|
||||||
<literal>mDNSResponder(8)</literal>. If the value is boolean, the service name is inferred from the SockService-Name. SockServiceName.
|
<literal>mDNSResponder(8)</literal>. If the value is boolean, the service name is inferred from the SockServiceName.
|
||||||
Name.
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -859,8 +889,8 @@ with lib;
|
||||||
description = ''
|
description = ''
|
||||||
This optional key can be used to request that the datagram socket join a multicast group. If the
|
This optional key can be used to request that the datagram socket join a multicast group. If the
|
||||||
value is a hostname, then <literal>getaddrinfo(3)</literal> will be used to join the correct multicast address for a
|
value is a hostname, then <literal>getaddrinfo(3)</literal> will be used to join the correct multicast address for a
|
||||||
given socket family. If an explicit IPv4 or IPv6 address is given, it is required that the Sock-Family SockFamily
|
given socket family. If an explicit IPv4 or IPv6 address is given, it is required that the SockFamily
|
||||||
Family family also be set, otherwise the results are undefined.
|
family also be set, otherwise the results are undefined.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -13,6 +13,7 @@ with lib;
|
||||||
SuccessfulExit = false;
|
SuccessfulExit = false;
|
||||||
};
|
};
|
||||||
ProcessType = "Background";
|
ProcessType = "Background";
|
||||||
|
UnrecognizedByHomeManager = "should make it to the resulting plist";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -19,5 +19,7 @@
|
||||||
<string>--with-arguments</string>
|
<string>--with-arguments</string>
|
||||||
<string>foo</string>
|
<string>foo</string>
|
||||||
</array>
|
</array>
|
||||||
|
<key>UnrecognizedByHomeManager</key>
|
||||||
|
<string>should make it to the resulting plist</string>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
Loading…
Add table
Reference in a new issue