From 91f7d08bac441ec9c90d0297a8373b286902a142 Mon Sep 17 00:00:00 2001
From: NullBite <me@nullbite.com>
Date: Sat, 22 Jun 2024 22:40:04 -0400
Subject: [PATCH] rpi4: mount home assistant subvol

---
 hosts/rpi4/configuration.nix          |  9 ++++++++-
 hosts/rpi4/hardware-configuration.nix | 13 +++++++++++++
 2 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/hosts/rpi4/configuration.nix b/hosts/rpi4/configuration.nix
index 6b0dc46..8ea1cae 100644
--- a/hosts/rpi4/configuration.nix
+++ b/hosts/rpi4/configuration.nix
@@ -12,7 +12,14 @@
     ];
 
   fileSystems = let
-    mounts = [ "/nix" "/" "/.btrfsroot" "/home" ];
+    mounts = [
+      "/nix"
+      "/"
+      "/.btrfsroot"
+      "/home"
+      "/opt/hassio"
+      "/opt/hassio/.snapshots"
+    ];
     fn = (x: { options = [ "compress=zstd" ];});
   in lib.genAttrs mounts fn;
 
diff --git a/hosts/rpi4/hardware-configuration.nix b/hosts/rpi4/hardware-configuration.nix
index 0a5949b..d3d2ebc 100644
--- a/hosts/rpi4/hardware-configuration.nix
+++ b/hosts/rpi4/hardware-configuration.nix
@@ -42,6 +42,19 @@
       fsType = "ext4";
     };
 
+  fileSystems."/opt/hassio" =
+    { device = "/dev/disk/by-uuid/112535b6-4318-4d26-812b-7baf0d65dae5";
+      fsType = "btrfs";
+      options = [ "subvol=/@hassio" ];
+    };
+
+  fileSystems."/opt/hassio/.snapshots" =
+    { device = "/dev/disk/by-uuid/112535b6-4318-4d26-812b-7baf0d65dae5";
+      fsType = "btrfs";
+      options = [ "subvol=/snapshots/@hassio" ];
+    };
+
+
   swapDevices = [ ];
 
   # Enables DHCP on each ethernet and wireless interface. In case of scripted networking