This commit is contained in:
2025-08-03 14:32:15 -05:00
parent 1d2762cb7c
commit 491c476bbb

View File

@@ -18,71 +18,94 @@
}; };
*/ */
containers.pihole = { containers = {
pihole = {
autoStart = true; autoStart = true;
privateNetwork = true; privateNetwork = true;
hostAddress = "192.168.100.10"; hostAddress = "192.168.100.10";
localAddress = "192.168.100.28"; localAddress = "192.168.100.28";
config = let config = let
pkgs-us = import inputs.nixpkgs-us { system = "x86_64-linux"; }; pkgs-us = import inputs.nixpkgs-us { system = "x86_64-linux"; };
in { in {
imports = [ imports = [
(import "${inputs.nixpkgs-us}/nixos/modules/services/networking/pihole-ftl.nix" { config = config.containers.pihole.config; inherit lib; pkgs = pkgs-us;}) (import "${inputs.nixpkgs-us}/nixos/modules/services/networking/pihole-ftl.nix" { config = config.containers.pihole.config; inherit lib; pkgs = pkgs-us;})
(import "${inputs.nixpkgs-us}/nixos/modules/services/web-apps/pihole-web.nix" { config = config.containers.pihole.config; inherit lib; pkgs = pkgs-us;}) (import "${inputs.nixpkgs-us}/nixos/modules/services/web-apps/pihole-web.nix" { config = config.containers.pihole.config; inherit lib; pkgs = pkgs-us;})
]; ];
services = { services = {
pihole-web = { pihole-web = {
enable = true; enable = true;
package = pkgs-us.pihole-web; package = pkgs-us.pihole-web;
#hostName = "192.168.100.28"; #hostName = "192.168.100.28";
ports = [ 80 ]; ports = [ 80 ];
}; };
pihole-ftl = { pihole-ftl = {
enable = true; enable = true;
package = pkgs-us.pihole-ftl; package = pkgs-us.pihole-ftl;
openFirewallDNS = true; openFirewallDNS = true;
openFirewallWebserver = true; openFirewallWebserver = true;
lists = [ lists = [
{ {
url = "https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts"; url = "https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts";
} }
];
settings = {
misc.dnsmasq_lines = [
"no-resolv"
"server=127.0.0.1@5335"
]; ];
};
};
unbound = { settings = {
enable = true; misc.dnsmasq_lines = [
"no-resolv"
settings = { "server=192.168.100.29"
server = { #"server=1.1.1.1"
interface = [ "127.0.0.1" ]; #"server=1.0.0.1"
port = 5335; ];
}; };
}; };
}; };
system.stateVersion = "25.05";
}; };
};
unbound = {
networking.nameservers = [ "127.0.0.1@5335" ]; autoStart = true;
privateNetwork = true;
hostAddress = "192.168.100.10";
localAddress = "192.168.100.29";
system.stateVersion = "24.05"; config = {
services = {
unbound = {
enable = true;
settings = {
server = {
interface = [ "0.0.0.0" ];
port = 53;
};
};
};
};
networking = {
firewall = {
allowedTCPPorts = [ 53 ];
allowedUDPPorts = [ 53 ];
};
};
system.stateVersion = "25.05";
};
}; };
}; };