From 343becaa577dad3c1a71120d37173cf3bafc20eb Mon Sep 17 00:00:00 2001 From: harry Date: Wed, 17 Jul 2024 14:30:30 +0200 Subject: [PATCH] started refactoring caddy & homelab config --- customs/caddy/default.nix | 11 +++++ features/caddy.nix | 17 +++++++ features/homelab-dashboard.nix | 82 ++++++++++++++++++++++++++++------ server-configuration.nix | 17 +------ 4 files changed, 97 insertions(+), 30 deletions(-) create mode 100644 customs/caddy/default.nix create mode 100644 features/caddy.nix diff --git a/customs/caddy/default.nix b/customs/caddy/default.nix new file mode 100644 index 0000000..3ac88a3 --- /dev/null +++ b/customs/caddy/default.nix @@ -0,0 +1,11 @@ +let + pkgs = import { }; + +in +{ + name = "caddy"; + buildInputs = with pkgs; [ + xcaddy + go + ]; +} diff --git a/features/caddy.nix b/features/caddy.nix new file mode 100644 index 0000000..7f4ea2d --- /dev/null +++ b/features/caddy.nix @@ -0,0 +1,17 @@ +{ }: +{ + services.caddy = { + enable = true; + virtualHosts.":80".extraConfig = '' + reverse_proxy :8082 + ''; + + virtualHosts.":3001".extraConfig = '' + reverse_proxy :3000 + ''; + virtualHosts.":4001".extraConfig = '' + reverse_proxy :4000 + ''; + }; + +} diff --git a/features/homelab-dashboard.nix b/features/homelab-dashboard.nix index f4c624b..d53f307 100644 --- a/features/homelab-dashboard.nix +++ b/features/homelab-dashboard.nix @@ -44,13 +44,21 @@ in prowlarr = { }; proxmoxPassword = { }; proxmoxUsername = { }; + uptimekuma = { }; }; services.homepage-dashboard = { enable = true; settings = { - "headerStyle" = "boxed"; + headerStyle = boxed; "language" = "fr"; + title = "sillybox home !!"; + layout = { + "Vidéos & Séries" = { + style = row; + columns = 4; + }; + }; }; widgets = [ { @@ -71,18 +79,27 @@ in services = [ { "Divertissement" = [ + { - "Jellyfin" = { - icon = "jellyfin"; - description = "Permet de regarder ou écouter du contenu."; - href = "http://${ip}:8096"; + "Serveur Minecraft poulet" = { + icon = "minecraft"; + description = "serveur des trois poulets"; widget = { - type = "jellyfin"; - url = "http://${ip}:8096"; - key = config.sops.secrets.jellyfin; + type = "minecraft"; + url = "udp://${ip}:25565"; }; }; } + { + "Crafty-controller" = { + description = "Gestionnaire de serveur Minecraft"; + href = "https://192.168.1.177:8443"; + }; + } + ]; + } + { + "Lecture" = [ { "Calibre-web" = { icon = "calibre"; @@ -91,15 +108,30 @@ in }; } { - "Serveur Minecraft poulet" = { - icon = "minecraft"; - description = "serveur des trois poulets"; + "Freshrss" = { + icon = "freshrss"; + description = "Récupère les articles"; + }; } ]; } { - "Téléchargement" = [ + "Vidéos & Séries" = [ + { + + "Jellyfin" = { + icon = "jellyfin"; + description = "Permet de regarder ou écouter du contenu."; + href = "http://${ip}:8096"; + widget = { + type = "jellyfin"; + url = "http://${ip}:8096"; + enableBlocks = true; + key = config.sops.secrets.jellyfin; + }; + }; + } { "Jellyseerr" = { icon = "jellyseerr"; @@ -149,7 +181,7 @@ in "Radarr" = { icon = "radarr"; description = "Moteur de recherche pour les films"; - href = "http://${ip}:7878/"; + href = "http://${ip}:7878"; widget = { type = "radarr"; key = config.sops.secrets.radarr; @@ -157,6 +189,17 @@ in }; }; } + { + "Bazarr" = { + icon = "bazarr"; + description = "Vérifie les sous titres des films/séries."; + href = "http://${ip}:6767"; + widget = { + type = "bazarr"; + key = config.sops.secrets.bazarr; + }; + }; + } { "Transmission" = { @@ -222,7 +265,7 @@ in widget = { type = "pihole"; key = config.sops.secrets.pihole; - url = "http://${cfg.piholeURL}/admin"; + url = "http://${cfg.piholeURL}"; }; }; } @@ -247,6 +290,17 @@ in href = "http://${ip}:4001"; }; } + { + "Uptime Robot" = { + icon = "uptimerobot"; + description = "Surveille l'état des sites (hors réseau maison)"; + widget = { + type = "uptimerobot"; + url = "https://api.uptimerobot.com"; + key = config.sops.secrets.uptimekuma; + }; + }; + } ]; } ]; diff --git a/server-configuration.nix b/server-configuration.nix index df3c6df..4757b4a 100644 --- a/server-configuration.nix +++ b/server-configuration.nix @@ -13,6 +13,7 @@ in imports = [ ./features/arr-suite.nix ./features/authentik.nix + ./features/caddy.nix ./features/calibre-web.nix ./features/containers.nix ./features/freshrss.nix @@ -108,20 +109,4 @@ in openFirewall = true; }; - services.caddy = { - enable = true; - virtualHosts.":80".extraConfig = '' - reverse_proxy :8082 - ''; - - virtualHosts.":3001".extraConfig = '' - reverse_proxy :3000 - ''; - virtualHosts.":4001".extraConfig = '' - reverse_proxy :4000 - ''; - virtualHosts.":8400".extraConfig = '' - reverse_proxy :8443 - ''; - }; }