mirror of
https://github.com/ellmau/nixos.git
synced 2025-12-19 09:29:36 +01:00
Add unbound service to server
This commit is contained in:
parent
68c413212d
commit
a75c2ae69a
@ -12,6 +12,7 @@ with lib; {
|
|||||||
./nginx.nix
|
./nginx.nix
|
||||||
./smailserver.nix
|
./smailserver.nix
|
||||||
./sql.nix
|
./sql.nix
|
||||||
|
./unbound.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
config =
|
config =
|
||||||
@ -24,6 +25,7 @@ with lib; {
|
|||||||
sql.enable = mkDefault true;
|
sql.enable = mkDefault true;
|
||||||
smailserver.enable = mkDefault false; # TODO fix simple mail server
|
smailserver.enable = mkDefault false; # TODO fix simple mail server
|
||||||
nextcloud.enable = mkDefault true;
|
nextcloud.enable = mkDefault true;
|
||||||
|
unbound.enable = mkDefault true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
30
modules/server/unbound.nix
Normal file
30
modules/server/unbound.nix
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
with lib; {
|
||||||
|
options.elss.server.unbound.enable = mkEnableOption "Set unbound dns up";
|
||||||
|
config =
|
||||||
|
let
|
||||||
|
cfg = config.elss.server.unbound;
|
||||||
|
in
|
||||||
|
mkIf cfg.enable {
|
||||||
|
services = {
|
||||||
|
resolved = {
|
||||||
|
enable = true;
|
||||||
|
dnssec = "true";
|
||||||
|
llmnr = "true";
|
||||||
|
fallbackDns = [ "127.0.0.1" "::1" ];
|
||||||
|
extraConfig = ''
|
||||||
|
DNS = 127.0.0.1 ::1
|
||||||
|
Domains = ~.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
unbound = {
|
||||||
|
enable = true;
|
||||||
|
settings.server.interface = [ "127.0.0.0" "::1" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
networking = {
|
||||||
|
nameservers = [ "127.0.0.1" "::1"];
|
||||||
|
resolvconf.useLocalResolver = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user