aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/by-name/co/constants/module.nix2
-rw-r--r--modules/by-name/dn/dns/module.nix27
2 files changed, 29 insertions, 0 deletions
diff --git a/modules/by-name/co/constants/module.nix b/modules/by-name/co/constants/module.nix
index 51bf68b..4ddb689 100644
--- a/modules/by-name/co/constants/module.nix
+++ b/modules/by-name/co/constants/module.nix
@@ -72,6 +72,7 @@
lpadmin = 358;
msr = 359;
polkituser = 360;
+ unbound = 361;
# As per the NixOS file, the uids should not be greater or equal to 400;
};
@@ -127,6 +128,7 @@
systemd-coredump # matches systemd-coredump user
systemd-oom
wpa_supplicant
+ unbound
;
# The gid should match the uid. Thus should not be >= 400;
diff --git a/modules/by-name/dn/dns/module.nix b/modules/by-name/dn/dns/module.nix
index 8f4ad37..cbd8d03 100644
--- a/modules/by-name/dn/dns/module.nix
+++ b/modules/by-name/dn/dns/module.nix
@@ -63,6 +63,25 @@ in {
};
config = lib.mkIf cfg.enable {
+ vhack.persist.directories = [
+ {
+ directory = "/var/lib/unbound";
+ user = "unbound";
+ group = "unbound";
+ mode = "0700";
+ }
+ ];
+
+ # Use unbound for resolving all local DNS queries.
+ # unbounds also has the upside to verify DNSSEC.
+ services.unbound = {
+ enable = true;
+ stateDir = "/var/lib/unbound";
+ resolveLocalQueries = true;
+ };
+
+ # Use nsd to serve our own zone files, with the configured NS record pointing to the
+ # servers ip address.
services.nsd = {
enable = true;
verbosity = 4;
@@ -82,5 +101,13 @@ in {
"network-online.target"
];
};
+ users = {
+ users = {
+ "unbound".uid = config.vhack.constants.ids.uids.unbound;
+ };
+ groups = {
+ "unbound".gid = config.vhack.constants.ids.gids.unbound;
+ };
+ };
};
}