From 59795e6fb172efa42500d798a8714cf18c063a21 Mon Sep 17 00:00:00 2001 From: Max Date: Sun, 5 Mar 2023 21:21:10 +0100 Subject: [PATCH] cluster/services/dns: generify coredns config --- cluster/services/dns/coredns.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cluster/services/dns/coredns.nix b/cluster/services/dns/coredns.nix index 5037e6e..e92247d 100644 --- a/cluster/services/dns/coredns.nix +++ b/cluster/services/dns/coredns.nix @@ -1,4 +1,4 @@ -{ config, hosts, inputs, pkgs, tools, ... }: +{ config, hosts, inputs, lib, pkgs, tools, ... }: let inherit (hosts.${config.networking.hostName}) interfaces; @@ -17,7 +17,7 @@ in }; systemd.services.coredns = { - after = [ "network-addresses-vstub.service" ]; + after = lib.optional (interfaces ? vstub) "network-addresses-vstub.service"; serviceConfig.LoadCredential = [ "dot-cert.pem:${dot.directory}/fullchain.pem" "dot-key.pem:${dot.directory}/key.pem" @@ -38,7 +38,7 @@ in enable = true; config = '' . { - bind ${interfaces.vstub.addr} + ${lib.optionalString (interfaces ? vstub) "bind ${interfaces.vstub.addr}"} bind 127.0.0.1 hosts ${stevenblack-hosts} { fallthrough