From c3fb0387b4348af07900349c737bd82e4b708085 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 27 May 2009 10:32:30 +0000 Subject: [PATCH] * Moved the expressions for generating Upstart jobs. svn path=/nixos/branches/modular-nixos/; revision=15748 --- modules/module-list.nix | 32 +++++++++---------- .../system/upstart}/make-job.nix | 0 .../system/upstart/tools.nix | 0 .../system/upstart/upstart.nix | 25 +++++++++++---- upstart-jobs/gather.nix | 17 ---------- 5 files changed, 34 insertions(+), 40 deletions(-) rename {upstart-jobs => modules/system/upstart}/make-job.nix (100%) rename upstart-jobs/lib/default.nix => modules/system/upstart/tools.nix (100%) rename upstart-jobs/default.nix => modules/system/upstart/upstart.nix (83%) delete mode 100644 upstart-jobs/gather.nix diff --git a/modules/module-list.nix b/modules/module-list.nix index 57f8a014a2a..4bee3419266 100644 --- a/modules/module-list.nix +++ b/modules/module-list.nix @@ -1,5 +1,20 @@ [ #./hardware/network/intel-3945abg.nix ../etc/default.nix + ../system/assertion.nix + ../system/nixos-environment.nix + ../system/nixos-installer.nix + ../system/system-options.nix + ../upstart-jobs/cron/locate.nix + ../upstart-jobs/filesystems.nix + ../upstart-jobs/guest-users.nix + ../upstart-jobs/kbd.nix + ../upstart-jobs/ldap + ../upstart-jobs/lvm.nix + ../upstart-jobs/network-interfaces.nix + ../upstart-jobs/pcmcia.nix + ../upstart-jobs/swap.nix + ../upstart-jobs/swraid.nix + ../upstart-jobs/tty-backgrounds.nix ./config/fonts.nix ./config/i18n.nix ./config/system-path.nix @@ -69,20 +84,5 @@ ./system/upstart-events/ctrl-alt-delete.nix ./system/upstart-events/halt.nix ./system/upstart-events/maintenance-shell.nix - ../system/assertion.nix - ../system/nixos-environment.nix - ../system/nixos-installer.nix - ../system/system-options.nix - ../upstart-jobs/cron/locate.nix - ../upstart-jobs/default.nix - ../upstart-jobs/filesystems.nix - ../upstart-jobs/guest-users.nix - ../upstart-jobs/kbd.nix - ../upstart-jobs/ldap - ../upstart-jobs/lvm.nix - ../upstart-jobs/network-interfaces.nix - ../upstart-jobs/pcmcia.nix - ../upstart-jobs/swap.nix - ../upstart-jobs/swraid.nix - ../upstart-jobs/tty-backgrounds.nix + ./system/upstart/upstart.nix ] diff --git a/upstart-jobs/make-job.nix b/modules/system/upstart/make-job.nix similarity index 100% rename from upstart-jobs/make-job.nix rename to modules/system/upstart/make-job.nix diff --git a/upstart-jobs/lib/default.nix b/modules/system/upstart/tools.nix similarity index 100% rename from upstart-jobs/lib/default.nix rename to modules/system/upstart/tools.nix diff --git a/upstart-jobs/default.nix b/modules/system/upstart/upstart.nix similarity index 83% rename from upstart-jobs/default.nix rename to modules/system/upstart/upstart.nix index 006f9e06276..459b8a76e98 100644 --- a/upstart-jobs/default.nix +++ b/modules/system/upstart/upstart.nix @@ -60,7 +60,7 @@ let modprobe = config.system.sbin.modprobe; mount = config.system.sbin.mount; - makeJob = import ../upstart-jobs/make-job.nix { + makeJob = import ./make-job.nix { inherit (pkgs) runCommand; }; @@ -73,18 +73,29 @@ let # User-defined events. ++ (map makeJob (config.services.extraJobs)); - - command = import ../upstart-jobs/gather.nix { - inherit (pkgs) runCommand; - inherit jobs; - }; + + # Create an etc/event.d directory containing symlinks to the + # specified list of Upstart job files. + command = pkgs.runCommand "upstart-jobs" {inherit jobs;} + '' + ensureDir $out/etc/event.d + for i in $jobs; do + if ln -s $i . ; then + if test -d $i; then + ln -s $i/etc/event.d/* $out/etc/event.d/ + fi + else + echo Duplicate entry: $i; + fi; + done + ''; in { require = [ options - ./lib/default.nix + ./tools.nix # !!! doesn't seem to be used anywhere ]; environment = { diff --git a/upstart-jobs/gather.nix b/upstart-jobs/gather.nix deleted file mode 100644 index 726503f1917..00000000000 --- a/upstart-jobs/gather.nix +++ /dev/null @@ -1,17 +0,0 @@ -# Create an etc/event.d directory containing symlinks to the -# specified list of Upstart job files. -{runCommand, jobs}: - -runCommand "upstart-jobs" {inherit jobs;} - " - ensureDir $out/etc/event.d - for i in $jobs; do - if ln -s $i . ; then - if test -d $i; then - ln -s $i/etc/event.d/* $out/etc/event.d/ - fi - else - echo Duplicate entry: $i; - fi; - done - "