Skip to content

Commit e1e0a7a

Browse files
committed
feat(mdadm): add extraArgs option
1 parent 36afd55 commit e1e0a7a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/types/mdadm.nix

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@
4040
parent = config;
4141
device = "/dev/md/${config.name}";
4242
};
43+
extraArgs = lib.mkOption {
44+
type = lib.types.listOf lib.types.str;
45+
default = [ ];
46+
example = [ "--assume-clean" ];
47+
description = "Extra arguments passed to `mdadm --create`";
48+
};
4349
_meta = lib.mkOption {
4450
internal = true;
4551
readOnly = true;
@@ -63,6 +69,7 @@
6369
--metadata=${config.metadata} \
6470
--force \
6571
--homehost=any \
72+
${toString (lib.map lib.escapeShellArg config.extraArgs)} \
6673
"''${disk_devices[@]}"
6774
partprobe "/dev/md/${config.name}"
6875
udevadm trigger --subsystem-match=block

0 commit comments

Comments
 (0)