From e65362ceef7861ff3e9eb507ff3a1af56b0673cf Mon Sep 17 00:00:00 2001 From: fidgetingbits Date: Wed, 10 Dec 2025 07:24:16 +0800 Subject: [PATCH] feat(mdadm): add extraArgs option --- lib/types/mdadm.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/types/mdadm.nix b/lib/types/mdadm.nix index 9b97217..d8939e1 100644 --- a/lib/types/mdadm.nix +++ b/lib/types/mdadm.nix @@ -40,6 +40,12 @@ parent = config; device = "/dev/md/${config.name}"; }; + extraArgs = lib.mkOption { + type = lib.types.listOf lib.types.str; + default = [ ]; + example = [ "--assume-clean" ]; + description = "Extra arguments passed to `mdadm --create`"; + }; _meta = lib.mkOption { internal = true; readOnly = true; @@ -63,6 +69,7 @@ --metadata=${config.metadata} \ --force \ --homehost=any \ + ${toString (lib.map lib.escapeShellArg config.extraArgs)} \ "''${disk_devices[@]}" partprobe "/dev/md/${config.name}" udevadm trigger --subsystem-match=block