Fix syntax errors

This commit is contained in:
Fabian Hauser 2020-05-17 13:52:15 +00:00
parent fad59bbb27
commit 87792bd9af
4 changed files with 156 additions and 144 deletions

View file

@ -2,10 +2,10 @@
with lib;
let routerCfg = config.services.router;
dhcpCfg = config.services.router.dhcp;
cfg = config.services.router.recursiveDns;
with lib.lists; with builtins; revIpDomain = concatStringsSep "." reverseList take 3 split "\." networkIdIp;
let
routerCfg = config.services.router;
dhcpCfg = config.services.router.dhcp;
cfg = config.services.router.recursiveDns;
in {
options.services.router.recursiveDns = {
enable = mkEnableOption "router recursive dns service";
@ -20,10 +20,16 @@ in {
};
config = mkIf cfg.enable {
services.unbound = {
services.unbound = let
revIpDomain = concatStringsSep "."
(reverseList (take 3 (splitString "." cfg.networkIdIp)));
in {
enable = true;
interfaces = [ "127.0.0.1" routerCfg.internalRouterIP ];
allowedAccess = [ "127.0.0.0/24" "${cfg.networkIdIp}/${toString routerCfg.internalPrefixLength}" ];
allowedAccess = [
"127.0.0.0/24"
"${cfg.networkIdIp}/${toString routerCfg.internalPrefixLength}"
];
extraConfig = mkIf dhcpCfg.enable ''
# Custom configuration (leave this note to assure indentation!)
do-not-query-localhost: no