From cd6d4eebe5dcc0114db2f7623c9bae98e09b2d31 Mon Sep 17 00:00:00 2001 From: noe Date: Fri, 31 May 2024 02:17:36 -0400 Subject: [PATCH] pihole: reset --- nixos/hosts/pihole/default.nix | 65 ++++++++++++---------------------- 1 file changed, 22 insertions(+), 43 deletions(-) diff --git a/nixos/hosts/pihole/default.nix b/nixos/hosts/pihole/default.nix index cdb6ad3..e4f13c0 100644 --- a/nixos/hosts/pihole/default.nix +++ b/nixos/hosts/pihole/default.nix @@ -4,56 +4,35 @@ ../../server.nix ../../features/dns-cache.nix ../../features/podman.nix - inputs.linger.nixosModules.x86_64-linux.default - inputs.pihole.nixosModules.x86_64-linux.default ]; networking.hostName = "pihole"; system.stateVersion = "24.11"; nixpkgs.hostPlatform = "x86_64-linux"; - boot.tmp.cleanOnBoot = lib.mkForce true; networking.firewall = { - allowedTCPPorts = [ - config.services.pihole.hostConfig.dnsPort - config.services.pihole.hostConfig.webPort - ]; - allowedUDPPorts = [ - config.services.pihole.hostConfig.dnsPort - ]; + allowedTCPPorts = [ 53 80 ]; + allowedUDPPorts = [ 53 ]; }; - - users.users.pihole = { - isNormalUser = true; - }; - - services.pihole = { - enable = true; - hostConfig = { - user = "root"; - enableLingeringForUser = true; - persistVolumes = true; - dnsPort = 5353; - webPort = 8080; - }; - piholeConfig = { - web = { - password = "abcd1234"; # todo? - virtualHost = "http://pihole.hoki-porgy.ts.net"; - theme = "default-darker"; - }; - dns = { - upstreamServers = [ - "10.0.0.1" - "1.1.1.1" - "1.0.0.1" - ]; - dnssec = true; - bogusPriv = true; - fqdnRequired = true; - }; - }; - }; - + # virtualisation.oci-containers.containers = { + # pihole = { + # image = "registry.docker.io/pihole/pihole"; + # ports = [ + # "53:53/tcp" + # "53:53/udp" + # "80:80/tcp" + # ]; + # volumes = [ + # "etc-pihole:/etc/pihole" + # "etc-dnsmasq.d:/etc/dnsmasq.d" + # ]; + # environment = { + # TZ = config.time.timeZone; + # VIRTUAL_HOST = "pihole.hoki-porgy.ts.net"; + # PROXY_LOCATION = "pihole.hoki-porgy.ts.net"; + # # FTLCONF_LOCAL_IPV4 = config.networking.interfaces.tailscale0.ipv4.addresses[0].address; + # }; + # }; + # }; }