* Simplify.
svn path=/nixos/branches/modular-nixos/; revision=16373
This commit is contained in:
parent
96fe3ba1b7
commit
1424399002
@ -4,22 +4,20 @@ let
|
|||||||
|
|
||||||
inherit (pkgs.lib) mkOption mergeListOption;
|
inherit (pkgs.lib) mkOption mergeListOption;
|
||||||
|
|
||||||
makeJob = job:
|
makeJob =
|
||||||
if job ? jobDrv then
|
{name, job, buildHook ? "true", passthru ? null}:
|
||||||
job.jobDrv
|
|
||||||
else
|
pkgs.runCommand ("upstart-" + name)
|
||||||
pkgs.runCommand ("upstart-" + job.name)
|
{ inherit buildHook job; }
|
||||||
{ inherit (job) job;
|
''
|
||||||
jobName = job.name;
|
eval "$buildHook"
|
||||||
buildHook = if job ? buildHook then job.buildHook else "true";
|
ensureDir $out/etc/event.d
|
||||||
}
|
echo "$job" > $out/etc/event.d/${name}
|
||||||
''
|
'';
|
||||||
eval "$buildHook"
|
|
||||||
ensureDir $out/etc/event.d
|
|
||||||
echo "$job" > $out/etc/event.d/$jobName
|
|
||||||
'';
|
|
||||||
|
|
||||||
jobs = map makeJob (config.jobs ++ config.services.extraJobs);
|
jobs =
|
||||||
|
[pkgs.upstart] # for the built-in logd job
|
||||||
|
++ map makeJob (config.jobs ++ config.services.extraJobs);
|
||||||
|
|
||||||
# Create an etc/event.d directory containing symlinks to the
|
# Create an etc/event.d directory containing symlinks to the
|
||||||
# specified list of Upstart job files.
|
# specified list of Upstart job files.
|
||||||
@ -98,11 +96,6 @@ in
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
services.extraJobs =
|
|
||||||
[ # For the built-in logd job.
|
|
||||||
{ jobDrv = pkgs.upstart; }
|
|
||||||
];
|
|
||||||
|
|
||||||
# see test/test-upstart-job.sh (!!! check whether this still works)
|
# see test/test-upstart-job.sh (!!! check whether this still works)
|
||||||
tests.upstartJobs = { recurseForDerivations = true; } //
|
tests.upstartJobs = { recurseForDerivations = true; } //
|
||||||
builtins.listToAttrs (map (job:
|
builtins.listToAttrs (map (job:
|
||||||
|
Loading…
Reference in New Issue
Block a user