feat(storage): add raid
We'll be using software raid for our impermanence persist drives on a1d1,
so we need to add a way to enable it
Change-Id: I1f2946b37e5950fe82b906df4ba191097c0d2abb
Reviewed-on: https://git.clicks.codes/c/Infra/NixFiles/+/723
Tested-by: Samuel Shuert <coded@clicks.codes>
Reviewed-by: Samuel Shuert <coded@clicks.codes>
diff --git a/modules/nixos/clicks/storage/raid/default.nix b/modules/nixos/clicks/storage/raid/default.nix
new file mode 100644
index 0000000..58371b1
--- /dev/null
+++ b/modules/nixos/clicks/storage/raid/default.nix
@@ -0,0 +1,15 @@
+# SPDX-FileCopyrightText: 2024 Clicks Codes
+#
+# SPDX-License-Identifier: GPL-3.0-only
+
+{ lib, config, ... }:
+let
+ cfg = config.clicks.storage.raid;
+in
+{
+ options.clicks.storage.raid = {
+ enable = lib.mkEnableOption "Enable software raid with mdadm";
+ };
+
+ config = lib.mkIf cfg.enable { boot.swraid.enable = true; };
+}
diff --git a/systems/x86_64-linux/a1d1/default.nix b/systems/x86_64-linux/a1d1/default.nix
index 3add29d..4f7e821 100644
--- a/systems/x86_64-linux/a1d1/default.nix
+++ b/systems/x86_64-linux/a1d1/default.nix
@@ -29,6 +29,7 @@
};
storage = {
+ raid.enable = true;
impermanence = {
enable = true;
device = "/dev/disk/by-uuid/ab5c2f52-a737-4b29-a505-e3d0b9d0714c";