Add caddy module with tailscale integration

This commit is contained in:
SebastianStork 2025-05-29 01:05:42 +02:00
parent 1f4b3e734b
commit e909dcd866
6 changed files with 164 additions and 147 deletions

View file

@ -1,8 +1,4 @@
{ config, ... }:
let
tsDomain = config.custom.services.tailscale.domain;
portOf = service: config.custom.services.${service}.port;
in
{
system.stateVersion = "24.11";
@ -20,28 +16,6 @@ in
isFunnel = true;
target = toString ./hedgedoc-redirect.html;
};
caddyServe = {
nextcloud = {
subdomain = "cloud";
port = portOf "nextcloud";
};
actualbudget = {
subdomain = "budget";
port = portOf "actualbudget";
};
};
};
nextcloud = {
enable = true;
domain = "cloud.${tsDomain}";
backups.enable = true;
};
actualbudget = {
enable = true;
domain = "budget.${tsDomain}";
backups.enable = true;
};
syncthing = {
@ -50,6 +24,26 @@ in
isServer = true;
backups.enable = true;
};
nextcloud = {
enable = true;
domain = "cloud.${config.custom.services.tailscale.domain}";
backups.enable = true;
};
actualbudget = {
enable = true;
domain = "budget.${config.custom.services.tailscale.domain}";
backups.enable = true;
};
caddy.virtualHosts = {
nextcloud = {
inherit (config.custom.services.nextcloud) domain port;
};
actualbudget = {
inherit (config.custom.services.actualbudget) domain port;
};
};
};
};
}