diff --git a/roles/sonarr.nix b/roles/sonarr.nix index b07e964..6c68860 100644 --- a/roles/sonarr.nix +++ b/roles/sonarr.nix @@ -6,15 +6,18 @@ traefikRoutes = { - hostname, - config, + host, ... }: + let + hostname = host.hostname; + config = host.config.sonarr; + in [ { name = "${hostname}-sonarr"; - rule = "Host(`${config.sonarr.domain}`)"; - target = "http://${config.ip}:8989"; + rule = "Host(`${config.domain}`)"; + target = "http://${host.ip}:8989"; } ]; diff --git a/roles/traefik.nix b/roles/traefik.nix index 2785541..5b727e2 100644 --- a/roles/traefik.nix +++ b/roles/traefik.nix @@ -29,8 +29,7 @@ concatMap ( role: role.traefikRoutes { - inherit hostname; - config = hosts.${hostname}.config; + host = hosts.${hostname}; } ) hosts.${hostname}.roles ) (builtins.attrNames hosts);