From d63f558eb57384fbf7ca41c5653c9c5d1ed1e430 Mon Sep 17 00:00:00 2001
From: Julien Malka <julien.malka@me.com>
Date: Sun, 26 Dec 2021 02:45:49 +0100
Subject: [PATCH 1/3] Status working now

---
 modules/homepage/default.nix |  1 -
 modules/status/checks.csv    | 14 ++++++++++----
 modules/status/default.nix   | 13 ++++++++-----
 3 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/modules/homepage/default.nix b/modules/homepage/default.nix
index 208368d..8b0c1e6 100644
--- a/modules/homepage/default.nix
+++ b/modules/homepage/default.nix
@@ -15,7 +15,6 @@ in
         enableACME = true;
         forceSSL = true;
         root = inputs.homepage;
-        default = true;
       };
 
       services.nginx.virtualHosts."www.julienmalka.me" = {
diff --git a/modules/status/checks.csv b/modules/status/checks.csv
index 9ee2e4f..159ea2f 100644
--- a/modules/status/checks.csv
+++ b/modules/status/checks.csv
@@ -1,4 +1,10 @@
-http,   200,  Homepage,         https://julienmalka.me
-http,  200,  CI,  https://ci.julienmalka.me
-ping,   0,    Newton,            newton.julienmalka.me
-
+http,   200,  Lisa,                   https://google.com
+http,   200,  Homepage,               https://julienmalka.me
+http,   200,  CI,                     https://ci.julienmalka.me
+http,   200,  Jellyfin,               https://tv.julienmalka.me
+http,   200,  Transmission,           https://downloads.julienmalka.me
+http,   200,  Sonarr,                 https://series.julienmalka.me
+http,   200,  Radarr,                 https://films.julienmalka.me
+http,   200,  Jackett,                https://jackett.julienmalka.me/UI/Dashboard
+ping,     0,  Newton,                 newton.julienmalka.me
+http,   200,  Cloud,                  cloud.julienmalka.me
diff --git a/modules/status/default.nix b/modules/status/default.nix
index 9989f2a..10e0664 100644
--- a/modules/status/default.nix
+++ b/modules/status/default.nix
@@ -5,7 +5,7 @@ let
 in
 {
 
-  options.luj.jackett = {
+  options.luj.status = {
     enable = mkEnableOption "activate status page";
     nginx.enable = mkEnableOption "activate nginx";
     nginx.subdomain = mkOption {
@@ -16,16 +16,19 @@ in
   config = mkIf cfg.enable (
     mkMerge [{
       systemd = {
-        timers.simple-timer = {
+        timers.tinystatus = {
           wantedBy = [ "timers.target" ];
           partOf = [ "tinystatus.service" ];
-          timerConfig.OnCalendar = "minutely";
+          timerConfig.OnCalendar = "*-*-* *:05,15,25,35,45,55:00";
+          timerConfig.Unit = "tinystatus.service";
         };
         services.tinystatus = {
           serviceConfig.Type = "oneshot";
+          path = [ pkgs.gawk pkgs.gnused pkgs.curl pkgs.netcat pkgs.unixtools.ping ];
           script = ''
-          mkdir -p /var/www/status
-          ${pkgs.tinystatus}/bin/tinystatus ${./checks.csv} > /var/www/status/index.html 
+            mkdir -p /var/www/status
+            ${pkgs.tinystatus}/bin/tinystatus ${./checks.csv} > /var/www/status/index.html
+            ${pkgs.gnused}/bin/sed -i 's/tinystatus/Services status/g' /var/www/status/index.html
           '';
         };
       };

From b3450bde4f0ddeb3749c7e00717e64c184de184f Mon Sep 17 00:00:00 2001
From: Julien Malka <julien.malka@me.com>
Date: Sun, 26 Dec 2021 13:16:06 +0100
Subject: [PATCH 2/3] Fixed a few things on the status page

---
 modules/status/checks.csv  | 2 +-
 modules/status/default.nix | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/modules/status/checks.csv b/modules/status/checks.csv
index 159ea2f..46beb17 100644
--- a/modules/status/checks.csv
+++ b/modules/status/checks.csv
@@ -6,5 +6,5 @@ http,   200,  Transmission,           https://downloads.julienmalka.me
 http,   200,  Sonarr,                 https://series.julienmalka.me
 http,   200,  Radarr,                 https://films.julienmalka.me
 http,   200,  Jackett,                https://jackett.julienmalka.me/UI/Dashboard
-ping,     0,  Newton,                 newton.julienmalka.me
+port,     0,  Newton,                 newton.julienmalka.me 45
 http,   200,  Cloud,                  cloud.julienmalka.me
diff --git a/modules/status/default.nix b/modules/status/default.nix
index 10e0664..b6f2f4b 100644
--- a/modules/status/default.nix
+++ b/modules/status/default.nix
@@ -29,6 +29,7 @@ in
             mkdir -p /var/www/status
             ${pkgs.tinystatus}/bin/tinystatus ${./checks.csv} > /var/www/status/index.html
             ${pkgs.gnused}/bin/sed -i 's/tinystatus/Services status/g' /var/www/status/index.html
+            ${pkgs.gnused}/bin/sed -i 's/80%/60%/g' /var/www/status/index.html
           '';
         };
       };

From d076710b90d9e14dba24036580f498fe63f9d737 Mon Sep 17 00:00:00 2001
From: Julien Malka <julien.malka@me.com>
Date: Sun, 26 Dec 2021 13:24:36 +0100
Subject: [PATCH 3/3] Actually every 5 minutes

---
 modules/status/default.nix | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/status/default.nix b/modules/status/default.nix
index b6f2f4b..0e59660 100644
--- a/modules/status/default.nix
+++ b/modules/status/default.nix
@@ -19,7 +19,7 @@ in
         timers.tinystatus = {
           wantedBy = [ "timers.target" ];
           partOf = [ "tinystatus.service" ];
-          timerConfig.OnCalendar = "*-*-* *:05,15,25,35,45,55:00";
+          timerConfig.OnCalendar = "*-*-* *:05,10,15,20,25,30,35,40,45,50,55:00";
           timerConfig.Unit = "tinystatus.service";
         };
         services.tinystatus = {