removed throw, renamed services.named to services.bind

This commit is contained in:
Wyatt J. Miller 2025-01-04 18:46:37 -05:00
parent 1484f3a04e
commit 1f5eda31b2

View File

@ -69,16 +69,9 @@ in {
};
};
# Validate that only one DNS server is enabled
imports = [
(lib.mkIf (cfg.bind.enable && cfg.technitium.enable) (throw "Only one DNS server can be enabled at a time"))
];
# Implementation of the configuration
config = lib.mkMerge [
# BIND DNS Server Configuration
(lib.mkIf cfg.bind.enable {
services.named = {
services.bind = {
enable = true;
interfaces = cfg.bind.settings.interfaces;
zones =
@ -97,9 +90,7 @@ in {
environment.systemPackages = [pkgs.bind];
})
# Technitium DNS Server Configuration
(lib.mkIf cfg.technitium.enable {
# Create a systemd service for Technitium
systemd.services.technitium-dns = {
description = "Technitium DNS Server";
wantedBy = ["multi-user.target"];
@ -123,8 +114,8 @@ in {
};
networking.firewall = {
allowedTCPPorts = [cfg.technitium.settings.port];
allowedUDPPorts = [cfg.technitium.settings.port];
allowedTCPPorts = [53 cfg.technitium.settings.port];
allowedUDPPorts = [53 cfg.technitium.settings.port];
};
environment.systemPackages = [pkgs.technitium];