mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-09-21 20:49:52 +03:00
ca780f4a18
This fixes a serious bug on NixOS with swraid where mdadm arrays weren't properly stopped on shutdown. Rather than fixing the unit by adding `Before=final.target` we completely move to upstream units, which uses systemd shutdown hooks instead. This also drives down maintenance costs for us.
19 lines
389 B
Nix
19 lines
389 B
Nix
{ pkgs, ... }:
|
|
|
|
{
|
|
|
|
environment.systemPackages = [ pkgs.mdadm ];
|
|
|
|
services.udev.packages = [ pkgs.mdadm ];
|
|
|
|
systemd.packages = [ pkgs.mdadm ];
|
|
systemd.shutdownPackages = [ pkgs.mdadm ];
|
|
|
|
boot.initrd.availableKernelModules = [ "md_mod" "raid0" "raid1" "raid10" "raid456" ];
|
|
|
|
boot.initrd.extraUdevRulesCommands = ''
|
|
cp -v ${pkgs.mdadm}/lib/udev/rules.d/*.rules $out/
|
|
'';
|
|
|
|
}
|