started refactoring caddy & homelab config

This commit is contained in:
Harry 2024-07-17 14:30:30 +02:00
parent 1b6335ed72
commit 343becaa57
4 changed files with 97 additions and 30 deletions

11
customs/caddy/default.nix Normal file
View file

@ -0,0 +1,11 @@
let
pkgs = import <nixpkgs> { };
in
{
name = "caddy";
buildInputs = with pkgs; [
xcaddy
go
];
}

17
features/caddy.nix Normal file
View file

@ -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
'';
};
}

View file

@ -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;
};
};
}
];
}
];

View file

@ -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
'';
};
}