summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2022-10-01 19:03:42 +0200
committerlassulus <lassulus@lassul.us>2022-10-02 13:06:59 +0200
commitfba7b03a2102c870ec7cbde257adc35337ef1b13 (patch)
treea9d204bf21e8377d984796d641a8ca01985291dd
parent527a945c64107950b81ac0d714b8ab4920723ad6 (diff)
types mdadm: add metadata option
-rw-r--r--types.nix6
1 files changed, 6 insertions, 0 deletions
diff --git a/types.nix b/types.nix
index 871da48..1c1a36a 100644
--- a/types.nix
+++ b/types.nix
@@ -892,6 +892,10 @@ rec {
type = types.int;
default = 1;
};
+ metadata = mkOption {
+ type = types.enum [ "1" "1.0" "1.1" "1.2" "default" "ddf" "imsm" ];
+ default = "default";
+ };
content = diskoLib.deviceType;
_meta = mkOption {
internal = true;
@@ -908,6 +912,8 @@ rec {
echo 'y' | mdadm --create /dev/md/${config.name} \
--level=${toString config.level} \
--raid-devices=''${RAIDDEVICES_N_${config.name}} \
+ --metadata=${config.metadata} \
+ --homehost=any \
''${RAIDDEVICES_${config.name}}
udevadm trigger --subsystem-match=block; udevadm settle
${optionalString (!isNull config.content) (config.content._create "/dev/md/${config.name}")}