nixpkgs/upstart-jobs/make-job.nix
Eelco Dolstra 4d4387a70e * Allow jobs to specify groups.
svn path=/nixos/trunk/; revision=8862
2007-06-10 20:13:12 +00:00

29 lines
714 B
Nix

{runCommand}: job:
(
if job ? jobDrv then
job.jobDrv
else
(
runCommand job.name {inherit (job) job;}
"ensureDir $out/etc/event.d; echo \"$job\" > $out/etc/event.d/$name"
)
)
//
{
# Allow jobs to declare extra packages that should be added to the
# system path.
extraPath = if job ? extraPath then job.extraPath else [];
# Allow jobs to declare extra files that should be added to /etc.
extraEtc = if job ? extraEtc then job.extraEtc else [];
# Allow jobs to declare user accounts that should be created.
users = if job ? users then job.users else [];
# Allow jobs to declare groups that should be created.
groups = if job ? groups then job.groups else [];
}