diff --git a/hosts/nas/configuration.nix b/hosts/nas/configuration.nix index 109c2ef..d07c2e5 100644 --- a/hosts/nas/configuration.nix +++ b/hosts/nas/configuration.nix @@ -50,13 +50,12 @@ in { }; # Impermanence - persist important directories + # Note: /var/lib/downloads and /var/lib/multimedia are mounted from LVM on RAID environment.persistence."/nix/persist/system" = { hideMounts = true; directories = [ "/var/lib/pyload" "/var/lib/jellyfin" - "/var/lib/downloads" - "/var/lib/multimedia" "/var/log" "/var/lib/nixos" "/var/bento" diff --git a/hosts/nas/hardware-configuration.nix b/hosts/nas/hardware-configuration.nix index ed15d9d..a3c3edd 100644 --- a/hosts/nas/hardware-configuration.nix +++ b/hosts/nas/hardware-configuration.nix @@ -12,10 +12,19 @@ }; boot.loader.efi.canTouchEfiVariables = true; boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; + boot.initrd.kernelModules = [ "dm-snapshot" ]; boot.kernelModules = [ "kvm-intel" ]; boot.extraModulePackages = [ ]; + # RAID 1 array for data storage + boot.swraid = { + enable = true; + mdadmConf = '' + DEVICE /dev/disk/by-id/ata-ST18000NM000J-2TV103_ZR52TBSB-part1 + DEVICE /dev/disk/by-id/ata-ST18000NM000J-2TV103_ZR52V9QX-part1 + ''; + }; + # Tmpfs root filesystem (ephemeral - resets on reboot) fileSystems."/" = { device = "none"; @@ -65,6 +74,17 @@ ]; }; + # LVM volumes on RAID array + fileSystems."/var/lib/downloads" = { + device = "/dev/vg-data/lv-downloads"; + fsType = "xfs"; + }; + + fileSystems."/var/lib/multimedia" = { + device = "/dev/vg-data/lv-multimedia"; + fsType = "xfs"; + }; + # DHCP networking networking.useDHCP = lib.mkDefault true;