From d82ad4efbcc1f8f9b234551bf82d609b4804ea58 Mon Sep 17 00:00:00 2001 From: Andre Date: Fri, 3 Jan 2025 15:33:30 -0500 Subject: [PATCH] System: clean up RAID definition --- modules/nixos/system/raid/default.nix | 15 ++++++++------- systems/x86_64-linux/Hevana/default.nix | 7 +++++-- systems/x86_64-linux/Khanda/default.nix | 3 --- systems/x86_64-linux/Shura/default.nix | 3 --- 4 files changed, 13 insertions(+), 15 deletions(-) diff --git a/modules/nixos/system/raid/default.nix b/modules/nixos/system/raid/default.nix index ffe5d85..7069aef 100644 --- a/modules/nixos/system/raid/default.nix +++ b/modules/nixos/system/raid/default.nix @@ -12,14 +12,15 @@ in options = { ${namespace}.raid = { enable = lib.mkEnableOption "Enables RAID support."; + mailAddr = lib.mkOption { + default = ""; + type = lib.types.str; + description = "Address to email in case of issues."; + example = "admin@example.com"; + }; + storage = { enable = lib.mkEnableOption "Enables support for the storage array."; - mailAddr = lib.mkOption { - default = ""; - type = lib.types.str; - description = "Address to email in case of issues."; - example = "admin@example.com"; - }; keyFile = lib.mkOption { default = ""; type = lib.types.str; @@ -36,7 +37,7 @@ in ${namespace}.raid.enable = true; boot.swraid.mdadmConf = '' ARRAY /dev/md/Sapana metadata=1.2 UUID=51076daf:efdb34dd:bce48342:3b549fcb - MAILADDR ${cfg.storage.mailAddr} + MAILADDR ${cfg.mailAddr} ''; # Auto-unlock RAID array with a key file diff --git a/systems/x86_64-linux/Hevana/default.nix b/systems/x86_64-linux/Hevana/default.nix index a637f7b..4e53771 100644 --- a/systems/x86_64-linux/Hevana/default.nix +++ b/systems/x86_64-linux/Hevana/default.nix @@ -115,10 +115,13 @@ in gpu.amd.enable = true; # Enable support for primary RAID array - raid.storage = { + raid = { enable = true; - keyFile = config.${namespace}.secrets.devices.storage.keyFile.path; mailAddr = config.${namespace}.secrets.users.aires.email; + storage = { + enable = true; + keyFile = config.${namespace}.secrets.devices.storage.keyFile.path; + }; }; services = { diff --git a/systems/x86_64-linux/Khanda/default.nix b/systems/x86_64-linux/Khanda/default.nix index d076649..26ed001 100644 --- a/systems/x86_64-linux/Khanda/default.nix +++ b/systems/x86_64-linux/Khanda/default.nix @@ -53,9 +53,6 @@ in powerManagement.enable = true; - # Enable support for primary RAID array (just in case) - raid.storage.enable = true; - services = { autoUpgrade = { enable = true; diff --git a/systems/x86_64-linux/Shura/default.nix b/systems/x86_64-linux/Shura/default.nix index e918d22..b3c4886 100644 --- a/systems/x86_64-linux/Shura/default.nix +++ b/systems/x86_64-linux/Shura/default.nix @@ -53,9 +53,6 @@ in keepassxc # Use native instead of Flatpak due to weird performance issues ]; - # Enable support for primary RAID array (just in case) - raid.storage.enable = true; - # Keep one week of generations. nix.retention = "7d";