nox/systems/auth-dns.noc.eh22.intern.nix

58 lines
1.2 KiB
Nix

{
pkgs,
lib,
...
}:
let
zones = (
lib.attrsets.mapAttrs' (name: fileType: {
name = name;
value = ../data/zones/${name};
}) (builtins.readDir ../data/zones)
);
knotConf = pkgs.writeText "knot.conf" ''
server:
listen: 0.0.0.0@53
listen: ::@53
log:
- target: syslog
any: info
template:
- id: default
storage: /etc/knot/zones
zonefile-load: difference-no-serial
semantic-checks: "on"
journal-content: all
zone:
- domain: noc.eh22.intern
'';
in
{
imports = [ ];
# enable knot authorative dns server
# ref: https://search.nüschtos.de/?query=services.knot
# https://www.knot-dns.cz/docs/3.4/html/configuration.html
environment.etc = (
lib.attrsets.mapAttrs' (name: value: {
name = "knot/zones/noc.eh22.intern.zone";
value = {
source = value;
};
}) zones
);
services.knot = {
enable = true;
settingsFile = knotConf;
};
# DO NOT CHANGE
# this defines the first version of NixOS that was installed on the machine so that programs with non-migratable data files are kept compatible
home-manager.users.noc.home.stateVersion = "24.11";
system.stateVersion = "24.11";
}