move admin pass to a file instead of in config and create helpful attrs

This commit is contained in:
tdback 2024-11-12 20:07:14 -05:00
parent 29ee1f98e7
commit 75ffe93bd1

View file

@ -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" ];
};