From 14243990025637ede3a608bd874b401be73ab860 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 15 Jul 2009 12:52:32 +0000 Subject: [PATCH] * Simplify. svn path=/nixos/branches/modular-nixos/; revision=16373 --- modules/system/upstart/upstart.nix | 33 ++++++++++++------------------ 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/modules/system/upstart/upstart.nix b/modules/system/upstart/upstart.nix index 7801afdbb892..2890ac977345 100644 --- a/modules/system/upstart/upstart.nix +++ b/modules/system/upstart/upstart.nix @@ -4,22 +4,20 @@ let inherit (pkgs.lib) mkOption mergeListOption; - makeJob = job: - if job ? jobDrv then - job.jobDrv - else - pkgs.runCommand ("upstart-" + job.name) - { inherit (job) job; - jobName = job.name; - buildHook = if job ? buildHook then job.buildHook else "true"; - } - '' - eval "$buildHook" - ensureDir $out/etc/event.d - echo "$job" > $out/etc/event.d/$jobName - ''; + makeJob = + {name, job, buildHook ? "true", passthru ? null}: + + pkgs.runCommand ("upstart-" + name) + { inherit buildHook job; } + '' + eval "$buildHook" + ensureDir $out/etc/event.d + echo "$job" > $out/etc/event.d/${name} + ''; - 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 # 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) tests.upstartJobs = { recurseForDerivations = true; } // builtins.listToAttrs (map (job: