* Declare the type of jobs.
svn path=/nixos/branches/modular-nixos/; revision=16375
This commit is contained in:
parent
f076849acd
commit
0e3bef4195
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
inherit (pkgs.lib) mkOption mergeListOption;
|
inherit (pkgs.lib) mkOption mergeListOption types;
|
||||||
|
|
||||||
makeJob =
|
makeJob =
|
||||||
{name, job, buildHook ? "true", passthru ? null}:
|
{name, job, buildHook ? "true", passthru ? null}:
|
||||||
@ -45,28 +45,55 @@ in
|
|||||||
|
|
||||||
jobs = mkOption {
|
jobs = mkOption {
|
||||||
default = [];
|
default = [];
|
||||||
|
description = ''
|
||||||
|
This option defines the system jobs started and managed by the
|
||||||
|
Upstart daemon.
|
||||||
|
'';
|
||||||
|
|
||||||
|
type = types.list types.optionSet;
|
||||||
|
|
||||||
|
options = {
|
||||||
|
|
||||||
|
name = mkOption {
|
||||||
|
type = types.string;
|
||||||
|
example = "sshd";
|
||||||
|
description = ''
|
||||||
|
Name of the Upstart job.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
job = mkOption {
|
||||||
|
type = types.string;
|
||||||
example =
|
example =
|
||||||
[ { name = "test-job";
|
''
|
||||||
job = ''
|
|
||||||
description "nc"
|
description "nc"
|
||||||
start on started network-interfaces
|
start on started network-interfaces
|
||||||
respawn
|
respawn
|
||||||
env PATH=/var/run/current-system/sw/bin
|
env PATH=/var/run/current-system/sw/bin
|
||||||
exec sh -c "echo 'hello world' | ${pkgs.netcat}/bin/nc -l -p 9000"
|
exec sh -c "echo 'hello world' | ${pkgs.netcat}/bin/nc -l -p 9000"
|
||||||
'';
|
'';
|
||||||
}
|
|
||||||
];
|
|
||||||
# should have some checks to verify the syntax
|
|
||||||
merge = pkgs.lib.mergeListOption;
|
|
||||||
description = ''
|
description = ''
|
||||||
This option defines the system jobs started and managed by the
|
Contents of the Upstart job.
|
||||||
Upstart daemon.
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
buildHook = mkOption {
|
||||||
|
type = types.string;
|
||||||
|
default = "true";
|
||||||
|
description = ''
|
||||||
|
Command run while building the Upstart job. Can be used
|
||||||
|
to perform simple regression tests (e.g., the Apache
|
||||||
|
Upstart job uses it to check the syntax of the generated
|
||||||
|
<filename>httpd.conf</filename>.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
services.extraJobs = mkOption {
|
services.extraJobs = mkOption {
|
||||||
default = [];
|
default = [];
|
||||||
merge = pkgs.lib.mergeListOption;
|
|
||||||
description = ''
|
description = ''
|
||||||
Obsolete - don't use.
|
Obsolete - don't use.
|
||||||
'';
|
'';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user