summary refs log tree commit diff
path: root/upstart-jobs/swraid.nix
diff options
context:
space:
mode:
authorMarc Weber <marco-oweber@gmx.de>2009-03-06 12:27:30 +0000
committerMarc Weber <marco-oweber@gmx.de>2009-03-06 12:27:30 +0000
commitea60090213ef5d98ba3071ef58fc5ba29e44f7ef (patch)
treec6dbb7c2467d21297ffe8408dfd4a8af52a6dd1b /upstart-jobs/swraid.nix
parentf05cccbc66d6123fbd076c4a1cbd5d4cfe18c6d7 (diff)
downloadnixpkgs-ea60090213ef5d98ba3071ef58fc5ba29e44f7ef.tar
nixpkgs-ea60090213ef5d98ba3071ef58fc5ba29e44f7ef.tar.gz
nixpkgs-ea60090213ef5d98ba3071ef58fc5ba29e44f7ef.tar.bz2
nixpkgs-ea60090213ef5d98ba3071ef58fc5ba29e44f7ef.tar.lz
nixpkgs-ea60090213ef5d98ba3071ef58fc5ba29e44f7ef.tar.xz
nixpkgs-ea60090213ef5d98ba3071ef58fc5ba29e44f7ef.tar.zst
nixpkgs-ea60090213ef5d98ba3071ef58fc5ba29e44f7ef.zip
Convert "swraid"
svn path=/nixos/branches/fix-style/; revision=14400
Diffstat (limited to 'upstart-jobs/swraid.nix')
-rw-r--r--upstart-jobs/swraid.nix60
1 files changed, 34 insertions, 26 deletions
diff --git a/upstart-jobs/swraid.nix b/upstart-jobs/swraid.nix
index 5cf7d82e383..a0a25efa354 100644
--- a/upstart-jobs/swraid.nix
+++ b/upstart-jobs/swraid.nix
@@ -1,36 +1,44 @@
-{modprobe, mdadm}:
+{pkgs, config, ...}:
+
+###### implementation
 
 let
 
   tempConf = "/var/run/mdadm.conf";
+  modprobe = config.system.sbin.modprobe;
+  inherit (pkgs) mdadm;
 
 in
   
 {
-  name = "swraid";
-  
-  job = "
-start on udev
-#start on new-devices
-
-script
-
-    # Load the necessary RAID personalities.
-    # !!! hm, doesn't the kernel load these automatically?
-    for mod in raid0 raid1 raid5; do
-        ${modprobe}/sbin/modprobe $mod || true
-    done
-
-    # Scan /proc/partitions for RAID devices.
-    ${mdadm}/sbin/mdadm --examine --brief --scan -c partitions > ${tempConf}
-
-    # Activate each device found.
-    ${mdadm}/sbin/mdadm --assemble -c ${tempConf} --scan
-
-    initctl emit new-devices
-    
-end script
-
-  ";
 
+  services = {
+    extraJobs = [{
+      name = "swraid";
+      
+      job = ''
+      start on udev
+      #start on new-devices
+      
+      script
+      
+          # Load the necessary RAID personalities.
+          # !!! hm, doesn't the kernel load these automatically?
+          for mod in raid0 raid1 raid5; do
+              ${modprobe}/sbin/modprobe $mod || true
+          done
+      
+          # Scan /proc/partitions for RAID devices.
+          ${mdadm}/sbin/mdadm --examine --brief --scan -c partitions > ${tempConf}
+      
+          # Activate each device found.
+          ${mdadm}/sbin/mdadm --assemble -c ${tempConf} --scan
+      
+          initctl emit new-devices
+          
+      end script
+      
+      '';
+    }];
+  };
 }