2018-07-20 20:56:59 +00:00
|
|
|
{ pkgs, ... }:
|
2009-03-06 12:27:30 +00:00
|
|
|
|
2007-01-11 00:40:28 +00:00
|
|
|
{
|
|
|
|
|
2010-05-16 20:40:04 +00:00
|
|
|
environment.systemPackages = [ pkgs.mdadm ];
|
2011-09-14 18:20:50 +00:00
|
|
|
|
2010-05-16 20:40:04 +00:00
|
|
|
services.udev.packages = [ pkgs.mdadm ];
|
2009-12-29 10:04:54 +00:00
|
|
|
|
2018-05-28 20:24:22 +00:00
|
|
|
boot.initrd.availableKernelModules = [ "md_mod" "raid0" "raid1" "raid10" "raid456" ];
|
2011-09-14 18:20:50 +00:00
|
|
|
|
2014-11-10 21:08:10 +00:00
|
|
|
boot.initrd.extraUdevRulesCommands = ''
|
|
|
|
cp -v ${pkgs.mdadm}/lib/udev/rules.d/*.rules $out/
|
|
|
|
'';
|
|
|
|
|
2016-03-09 18:06:27 +00:00
|
|
|
systemd.services.mdadm-shutdown = {
|
2016-02-25 13:08:27 +00:00
|
|
|
wantedBy = [ "final.target"];
|
|
|
|
after = [ "umount.target" ];
|
|
|
|
|
|
|
|
unitConfig = {
|
|
|
|
DefaultDependencies = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
serviceConfig = {
|
|
|
|
Type = "oneshot";
|
|
|
|
ExecStart = ''${pkgs.mdadm}/bin/mdadm --wait-clean --scan'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
systemd.services."mdmon@" = {
|
|
|
|
description = "MD Metadata Monitor on /dev/%I";
|
|
|
|
|
|
|
|
unitConfig.DefaultDependencies = false;
|
|
|
|
|
|
|
|
serviceConfig = {
|
|
|
|
Type = "forking";
|
|
|
|
Environment = "IMSM_NO_PLATFORM=1";
|
|
|
|
ExecStart = ''${pkgs.mdadm}/bin/mdmon --offroot --takeover %I'';
|
|
|
|
KillMode = "none";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
systemd.services."mdadm-grow-continue@" = {
|
|
|
|
description = "Manage MD Reshape on /dev/%I";
|
|
|
|
|
|
|
|
unitConfig.DefaultDependencies = false;
|
|
|
|
|
|
|
|
serviceConfig = {
|
|
|
|
ExecStart = ''${pkgs.mdadm}/bin/mdadm --grow --continue /dev/%I'';
|
|
|
|
StandardInput = "null";
|
|
|
|
StandardOutput = "null";
|
|
|
|
StandardError = "null";
|
|
|
|
KillMode = "none";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2007-01-11 00:40:28 +00:00
|
|
|
}
|