mirror of
https://github.com/CHN-beta/nixos.git
synced 2024-10-23 15:29:10 +08:00
整理mdadm
This commit is contained in:
parent
782f08d860
commit
4e2a01a90c
@ -139,6 +139,8 @@
|
|||||||
"/dev/disk/by-uuid/55fdd19f-0f1d-4c37-bd4e-6df44fc31f26" = { mapper = "root"; ssd = true; };
|
"/dev/disk/by-uuid/55fdd19f-0f1d-4c37-bd4e-6df44fc31f26" = { mapper = "root"; ssd = true; };
|
||||||
"/dev/md/swap" = { mapper = "swap"; ssd = true; };
|
"/dev/md/swap" = { mapper = "swap"; ssd = true; };
|
||||||
};
|
};
|
||||||
|
mdadm =
|
||||||
|
"ARRAY /dev/md/swap metadata=1.2 name=chn-PC:swap UUID=2b546b8d:e38007c8:02990dd1:df9e23a4";
|
||||||
};
|
};
|
||||||
};}
|
};}
|
||||||
)
|
)
|
||||||
|
@ -124,11 +124,6 @@ inputs:
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
services.swraid =
|
|
||||||
{
|
|
||||||
enable = true;
|
|
||||||
mdadmConf = "ARRAY /dev/md/swap metadata=1.2 name=chn-PC:swap UUID=2b546b8d:e38007c8:02990dd1:df9e23a4";
|
|
||||||
};
|
|
||||||
# modules in initrd
|
# modules in initrd
|
||||||
# modprobe --show-depends
|
# modprobe --show-depends
|
||||||
availableKernelModules =
|
availableKernelModules =
|
||||||
|
@ -11,6 +11,7 @@ inputs:
|
|||||||
};
|
};
|
||||||
decrypt.auto = mkOption { type = types.attrsOf (types.submodule { options =
|
decrypt.auto = mkOption { type = types.attrsOf (types.submodule { options =
|
||||||
{ mapper = mkOption { type = types.nonEmptyStr; }; ssd = mkOption { type = types.bool; }; }; }); };
|
{ mapper = mkOption { type = types.nonEmptyStr; }; ssd = mkOption { type = types.bool; }; }; }); };
|
||||||
|
mdadm = mkOption { type = types.nullOr types.str; };
|
||||||
|
|
||||||
# swap and resume
|
# swap and resume
|
||||||
# swap != resume.device if swap is a file
|
# swap != resume.device if swap is a file
|
||||||
@ -51,7 +52,9 @@ inputs:
|
|||||||
)
|
)
|
||||||
(inputs.localLib.attrsToList inputs.config.nixos.fileSystems.mount.btrfs)))
|
(inputs.localLib.attrsToList inputs.config.nixos.fileSystems.mount.btrfs)))
|
||||||
);
|
);
|
||||||
boot.initrd.luks.devices =
|
boot.initrd =
|
||||||
|
{
|
||||||
|
luks.devices =
|
||||||
(
|
(
|
||||||
builtins.listToAttrs (builtins.map
|
builtins.listToAttrs (builtins.map
|
||||||
(
|
(
|
||||||
@ -69,6 +72,12 @@ inputs:
|
|||||||
)
|
)
|
||||||
(inputs.localLib.attrsToList inputs.config.nixos.fileSystems.decrypt.auto))
|
(inputs.localLib.attrsToList inputs.config.nixos.fileSystems.decrypt.auto))
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
// (
|
||||||
|
if inputs.config.nixos.fileSystems.mdadm != null then
|
||||||
|
{ services.swraid = { enable = true; mdadmConf = inputs.config.nixos.fileSystems.mdadm; }; }
|
||||||
|
else {}
|
||||||
|
);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user