From 7c7962a941119b3292962efaee22fd122a321e5a Mon Sep 17 00:00:00 2001
From: matt1432 <matt@nelim.org>
Date: Thu, 7 Mar 2024 00:04:39 -0500
Subject: [PATCH] fix(homepage): force hosts to resolve widgets

---
 .../nos/modules/arion/homepage/compose.nix    | 87 +++++++++----------
 1 file changed, 42 insertions(+), 45 deletions(-)

diff --git a/devices/nos/modules/arion/homepage/compose.nix b/devices/nos/modules/arion/homepage/compose.nix
index f3641c78..0d9b33a1 100644
--- a/devices/nos/modules/arion/homepage/compose.nix
+++ b/devices/nos/modules/arion/homepage/compose.nix
@@ -2,60 +2,57 @@
   inherit (config.arion) toYAML;
   inherit (config.sops) secrets;
 in {
-  # FIXME: Try to get homepage to resolve lan.nelim.org
-  #systemd.services."arion-homepage".after = ["tailscaled.service"];
+  arion.projects."homepage"."homepage" = {
+    image = ./images/homepage.nix;
+    restart = "always";
 
-  arion.projects."homepage" = {
-    "homepage" = {
-      image = ./images/homepage.nix;
-      restart = "always";
+    ports = [
+      "3020:3000"
+    ];
 
-      ports = [
-        "3020:3000"
-      ];
+    extra_hosts = ["lan.nelim.org=10.0.0.130"];
 
-      env_file = [secrets.homepage.path];
+    env_file = [secrets.homepage.path];
 
-      volumes = let
-        services = toYAML "services.yaml" (import ./services.nix);
+    volumes = let
+      services = toYAML "services.yaml" (import ./services.nix);
 
-        bookmarks = toYAML "bookmarks.yaml" {};
+      bookmarks = toYAML "bookmarks.yaml" {};
 
-        settings = toYAML "settings.yaml" {
-          # FIXME: title not working
-          title = "bruh";
-          theme = "dark";
-          color = "gray";
-          target = "_self";
+      settings = toYAML "settings.yaml" {
+        # FIXME: title not working
+        title = "bruh";
+        theme = "dark";
+        color = "gray";
+        target = "_self";
 
-          layout.video = {
-            style = "columns";
-            row = 4;
-            # columns = 2;
-          };
+        layout.video = {
+          style = "columns";
+          row = 4;
+          # columns = 2;
         };
+      };
 
-        widgets = toYAML "widgets.yaml" [
-          {
-            resources = {
-              cpu = true;
-              memory = true;
-              disk = "/";
-            };
-          }
-          {
-            search = {
-              provider = "duckduckgo";
-              target = "_blank";
-            };
-          }
-        ];
-      in [
-        "${bookmarks}:/app/config/bookmarks.yaml:ro"
-        "${services}:/app/config/services.yaml:ro"
-        "${settings}:/app/config/settings.yaml:ro"
-        "${widgets}:/app/config/widgets.yaml:ro"
+      widgets = toYAML "widgets.yaml" [
+        {
+          resources = {
+            cpu = true;
+            memory = true;
+            disk = "/";
+          };
+        }
+        {
+          search = {
+            provider = "duckduckgo";
+            target = "_blank";
+          };
+        }
       ];
-    };
+    in [
+      "${bookmarks}:/app/config/bookmarks.yaml:ro"
+      "${services}:/app/config/services.yaml:ro"
+      "${settings}:/app/config/settings.yaml:ro"
+      "${widgets}:/app/config/widgets.yaml:ro"
+    ];
   };
 }