nix/hosts/caddy/default.nix
2025-01-06 18:24:12 +01:00

154 lines
3 KiB
Nix

{
config,
pkgs,
lib,
...
}:
let
tailscaleMagicDNS = "neon-dory.ts.net";
publicDomain = "pazpi.top";
tsDomain = "tegola.pro";
email = "pasettodavide@gmail.com";
in
{
age.secrets = {
searx-secret.file = ../../secrets/searx-secret.age;
tailscale-authKey.file = ../../secrets/tailscale-authKey.age;
cloudflare-tegola-apiKey = {
file = ../../secrets/cloudflare-tegola-apiKey.age;
owner = config.services.caddy.user;
group = config.services.caddy.group;
};
};
my = {
utils.commons.enable = true;
services = {
dashy = {
enable = true;
settings = import ./dashy-settings.nix;
proxy = {
enable = true;
domain = tsDomain;
host = "caddy.internal";
};
};
media-mgr = {
proxy = {
enable = true;
domain = tsDomain;
host = "arr.internal";
};
};
nextcloud = {
proxy = {
enable = true;
domain = tsDomain;
host = "nextcloud.internal";
};
};
searx = {
enable = true;
secretFile = config.age.secrets.searx-secret.path;
proxy = {
enable = true;
domain = tsDomain;
host = "caddy.internal";
};
};
vaultwarden = {
proxy = {
enable = true;
domain = tsDomain;
host = "vaultwarden.internal";
};
};
};
monitoring = {
prometheus = {
proxy = {
enable = true;
domain = tsDomain;
host = "metrics.internal";
};
};
grafana = {
proxy = {
enable = true;
domain = tsDomain;
host = "metrics.internal";
};
};
};
networking = {
tailscale = {
enable = true;
magicDNSDomain = tailscaleMagicDNS;
authKeyFile = config.age.secrets.tailscale-authKey.path;
};
caddy = {
enable = true;
domainsList = [
{
domain = tsDomain;
email = email;
cloudflareApiKeyFile = config.age.secrets.cloudflare-tegola-apiKey.path;
}
];
# email = "pasettodavide@gmail.com";
# domain = tsDomain;
# claudflareApiKeyFile = config.age.secrets.cloudflare-tegola-apiKey.path;
};
};
virtualisation = {
proxmox.enable = true;
portainer.proxy = {
enable = true;
domain = tsDomain;
host = "portainer.internal";
};
};
};
time.timeZone = "Europe/Rome";
# Extra packages
environment.systemPackages = with pkgs; [ ];
services = {
openssh.enable = true;
iperf3 = {
enable = true;
openFirewall = true;
};
prometheus.exporters = {
node = {
enable = true;
enabledCollectors = [ "systemd" ];
};
};
};
networking = {
firewall.allowedTCPPorts = [ 9100 ];
nameservers = [ "192.168.1.2" ];
};
system.stateVersion = "24.05";
}