Add pihole to NixOS, using NixOS container specifiers

This commit is contained in:
Eli Ribble 2024-07-20 04:16:23 +00:00
parent 2d76497a03
commit a818c22412
1 changed files with 21 additions and 0 deletions

View File

@ -149,6 +149,27 @@
# Enable podman since we are on NixOS 21.05
virtualisation.docker.enable = false;
virtualisation.oci-containers.backend = "podman";
virtualisation.oci-containers.containers = {
pihole = {
autoStart = true;
environment = {
TZ = "America/Phoenix";
DNSMASQ_LISTENING = "all";
};
image = "docker.io/pihole/pihole:2024.07.0";
ports = [
"192.168.1.5:53:53/tcp"
"192.168.1.5:53:53/udp"
"192.168.1.5:67:67"
"127.0.0.1:10000:80"
];
volumes = [
"/etc/pihole/config:/etc/pihole"
"/etc/pihole/dnsmasq.d:/etc/dnsmasq.d"
];
};
};
virtualisation.podman.enable = true;
virtualisation.podman.dockerSocket.enable = true;
virtualisation.podman.defaultNetwork.settings.dns_enabled = true;