diff --git a/containers/pihole/default.nix b/containers/pihole/default.nix index 6c8042d..e144d83 100644 --- a/containers/pihole/default.nix +++ b/containers/pihole/default.nix @@ -1,11 +1,13 @@ -{ ... }: +{ lib, ... }: let - directories = [ - "/opt/pihole/" - ]; + ip = "10.0.0.203"; + interface = "eno1"; + directory = "/opt/pihole"; in { - systemd.tmpfiles.rules = map (x: "d ${x} 0755 share share - -") directories; + systemd.tmpfiles.rules = + map (x: "d ${x} 0755 share share - -") (lib.lists.singleton directory); + virtualisation.oci-containers.containers.pihole = { image = "pihole/pihole:latest"; autoStart = true; @@ -15,14 +17,14 @@ in "80:80/tcp" ]; volumes = [ - "/opt/pihole/etc:/etc/pihole" - "/opt/pihole/etc-dnsmasq.d:/etc/dnsmasq.d" + "${directory}/etc:/etc/pihole" + "${directory}/etc-dnsmasq.d:/etc/dnsmasq.d" ]; environment = { TZ = "America/Detroit"; - WEBPASSWORD = "pihole4ALL!"; - FTLCONF_LOCAL_IPV4 = "10.0.0.202"; - INTERFACE = "eno1"; + WEBPASSWORD_FILE = "${directory}/webpass"; + FTLCONF_LOCAL_IPV4 = ip; + INTERFACE = interface; }; extraOptions = [ "--network=host" ]; };