* Declare the type of jobs.

svn path=/nixos/branches/modular-nixos/; revision=16375
This commit is contained in:
Eelco Dolstra 2009-07-15 13:41:00 +00:00
parent f076849acd
commit 0e3bef4195
2 changed files with 42 additions and 15 deletions

View File

@ -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 = [];
example = description = ''
[ { name = "test-job"; This option defines the system jobs started and managed by the
job = '' 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 =
''
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"
''; '';
} description = ''
]; Contents of the Upstart job.
# should have some checks to verify the syntax '';
merge = pkgs.lib.mergeListOption; };
description = ''
This option defines the system jobs started and managed by the buildHook = mkOption {
Upstart daemon. 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.
''; '';

View File

@ -42,7 +42,7 @@ let
"; ";
type = types.nullOr (types.list types.optionSet); type = types.nullOr (types.list types.optionSet);
options = { options = {
mountPoint = mkOption { mountPoint = mkOption {
example = "/mnt/usb"; example = "/mnt/usb";