From 88eb38fba361e4b2d26dc5941bf150056a09dee3 Mon Sep 17 00:00:00 2001 From: jopejoe1 Date: Mon, 6 Mar 2023 13:52:34 +0100 Subject: [PATCH] Forgot to commit dns module --- modules/system/dns/default.nix | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 modules/system/dns/default.nix diff --git a/modules/system/dns/default.nix b/modules/system/dns/default.nix new file mode 100644 index 0000000..0a915ec --- /dev/null +++ b/modules/system/dns/default.nix @@ -0,0 +1,24 @@ +{ options, config, pkgs, lib, ... }: + +with lib; +#with lib.internal; +let cfg = config.custom.system.dns; +in +{ + options.custom.system.dns = with types; { + enable = mkBoolOpt false "Whether or not to enable creation of dns server."; + }; + + config = mkIf cfg.enable { + services.bind = { + enable = true; + services.bind.forwarders = []; + zones = { + "." = { + file = pkgs.dns-root-data.path + "/root.hints"; + }; + }; + }; + }; +} +