dotfiles.nix/nixos/viridian/containers/adguardhome.nix

43 lines
910 B
Nix
Raw Normal View History

2024-01-23 09:44:06 +08:00
{ ... }:
2024-06-16 23:08:52 +08:00
let
port = "3000";
in
2024-01-23 09:44:06 +08:00
{
virtualisation.oci-containers.containers = {
adguardhome = {
autoStart = true;
2024-06-16 23:08:52 +08:00
image = "adguard/adguardhome:v0.107.51";
2024-01-23 09:44:06 +08:00
ports = [
"53:53" # Plain DNS
2024-06-16 23:08:52 +08:00
"${port}:3000" # WEBGUI
2024-01-23 09:44:06 +08:00
];
volumes = [
"/srv/containers/adguardhome/work:/opt/adguardhome/work"
"/srv/containers/adguardhome/conf:/opt/adguardhome/conf"
];
extraOptions = [
"--network=host"
];
};
};
services.traefik.dynamicConfigOptions.http.routers = {
adguard-home = {
rule = "Host(`adguard.kanto.dev`)";
entryPoints = [
"websecure"
];
middlewares = [
"admin"
];
service = "adguard-home";
};
};
services.traefik.dynamicConfigOptions.http.services = {
adguard-home.loadBalancer.servers = [
2024-06-16 23:08:52 +08:00
{ url = "http://127.0.0.1:${port}"; }
];
};
2024-01-23 09:44:06 +08:00
}