2024-08-29 13:14:27 +00:00
|
|
|
{ lib, config, ... }:
|
|
|
|
let
|
|
|
|
cfg = config.aux.system.raid;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
|
|
|
|
options = {
|
|
|
|
aux.system.raid = {
|
|
|
|
enable = lib.mkEnableOption "Enables RAID support.";
|
2024-09-06 19:26:40 +00:00
|
|
|
storage.enable = lib.mkEnableOption "Enables support for the storage array.";
|
2024-08-29 13:14:27 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = lib.mkMerge [
|
|
|
|
(lib.mkIf cfg.enable { boot.swraid.enable = true; })
|
2024-09-06 19:26:40 +00:00
|
|
|
(lib.mkIf cfg.storage.enable {
|
2024-08-29 13:14:27 +00:00
|
|
|
aux.system.raid.enable = true;
|
|
|
|
boot.swraid.mdadmConf = ''
|
|
|
|
ARRAY /dev/md/Sapana metadata=1.2 UUID=51076daf:efdb34dd:bce48342:3b549fcb
|
|
|
|
MAILADDR ${config.secrets.users.aires.email}
|
|
|
|
'';
|
|
|
|
})
|
|
|
|
];
|
|
|
|
}
|