summary refs log tree commit diff stats
path: root/modules
diff options
context:
space:
mode:
authorChristian Krinitsin <code@krinitsin.xyz>2025-04-07 14:36:12 +0200
committerChristian Krinitsin <code@krinitsin.xyz>2025-04-07 14:36:12 +0200
commit97be7bf1360c756701dbffac9ac16a20ec92b0b2 (patch)
tree1913bdc7858a4b77e30bdb71782cc44c576a8f9e /modules
parentbacd7411c549623b11426fc43ee3a81bb45f14f7 (diff)
downloadnosix-97be7bf1360c756701dbffac9ac16a20ec92b0b2.tar.gz
nosix-97be7bf1360c756701dbffac9ac16a20ec92b0b2.zip
add glance, a dashboard
Diffstat (limited to 'modules')
-rw-r--r--modules/glance.nix143
1 files changed, 143 insertions, 0 deletions
diff --git a/modules/glance.nix b/modules/glance.nix
new file mode 100644
index 0000000..df16754
--- /dev/null
+++ b/modules/glance.nix
@@ -0,0 +1,143 @@
+{ pkgs, libs, config, ... }:
+let
+  unstable = import <nixos-unstable> {};
+in
+{
+
+  services.glance = {
+    enable = true;
+    package = unstable.glance;
+    settings = {
+      server = {
+        host = "localhost";
+        port = 5678;
+        assets-path = "/var/glance-assets";
+        base_url = "dash.krinitsin.com";
+      };
+
+      theme = {
+        background-color = "204 14 20";
+        primary-color = "41 32 75";
+        positive-color = "172 29 61";
+        negative-color = "358 69 68";
+        text-saturation-multiplier = 1.0;
+      };
+    };
+
+    settings.pages = [
+      {
+        name = "Home";
+        columns = [
+          {
+            size = "small";
+            widgets = [
+              {
+                type = "calendar";
+              }
+              {
+                type = "iframe";
+                title = "Mensa";
+                source = "https://krinitsin.com/mensa/";
+                height = 350;
+              }
+            ];
+          }
+          {
+            size = "full";
+            widgets = [
+              {
+                location = "Munich, Germany";
+                type = "weather";
+              }
+              {
+                type = "lobsters";
+                title = "News";
+                sort-by = "hot";
+              }
+            ];
+          }
+          {
+            size = "small";
+            widgets = [
+              {
+                cache = "1m";
+                title = "Services";
+                sites = [
+                  {
+                    title = "Vaultwarden";
+                    url = "https://vault.krinitsin.com";
+                    icon = "/assets/vaultwarden.png";
+                  }
+                  {
+                    title = "Git";
+                    url = "https://git.krinitsin.com";
+                    icon = "si:git";
+                  }
+                  {
+                    title = "Mealie";
+                    url = "https://recipes.krinitsin.com";
+                    icon = "/assets/mealie.png";
+                  }
+                  {
+                    title = "PDF";
+                    url = "https://pdf.krinitsin.com";
+                    icon = "di:stirling-pdf";
+                  }
+                  {
+                    title = "Polaris";
+                    url = "https://music.krinitsin.com";
+                    icon = "/assets/polaris.webp";
+                  }
+                  {
+                    title = "Radicale";
+                    url = "https://caldav.krinitsin.com";
+                    icon = "/assets/radicale.png";
+                  }
+                  {
+                    title = "Monit";
+                    url = "https://status.krinitsin.com/";
+                    check-url = "https://google.com";
+                    icon = "/assets/monit.png";
+                  }
+                  {
+                    title = "Shopping List";
+                    url = "https://krinitsin.com/shopping/";
+                    check-url = "https://google.com";
+                    icon = "/assets/monit.png";
+                  }
+                  {
+                    title = "Mensa";
+                    url = "https://krinitsin.com/mensa/";
+                    icon = "/assets/monit.png";
+                  }
+                  {
+                    title = "Webmail";
+                    url = "https://webmail.krinitsin.com";
+                    icon = "si:roundcube";
+                  }
+                ];
+                type = "monitor";
+              }
+            ];
+          }
+        ];
+      }
+    ];
+
+    openFirewall = true;
+  };
+  
+  services.nginx.virtualHosts."dash.krinitsin.com" = {
+    forceSSL = true;
+    useACMEHost = "krinitsin.com";
+    locations."/".proxyPass = "http://localhost:5678";
+  };
+
+  security.acme.certs."krinitsin.com".extraDomainNames = [ "dash.krinitsin.com" ];
+
+  services.monit.config = ''
+    check process glance with matching "glance"
+    start program = "${pkgs.systemd}/bin/systemctl start glance"
+    stop program = "${pkgs.systemd}/bin/systemctl stop glance"
+  '';
+}