Add pihole docker container

This commit is contained in:
2020-04-17 00:47:17 +02:00
parent 7927cc183f
commit 2b283d5588
4 changed files with 44 additions and 7 deletions

36
modules/containers.nix Normal file
View File

@@ -0,0 +1,36 @@
{ config, lib, pkgs, ... }:
{
# Enable Docker
virtualisation.docker = {
enable = true;
storageDriver = "overlay2";
};
# Container setup
docker-containers = {
pihole = {
image = "pihole/pihole:latest";
ports = [
"53:53/tcp"
"53:53/udp"
"3080:80"
"30443:443"
];
volumes = [
"/var/lib/pihole/:/etc/pihole/"
"/var/lib/dnsmasq/.d:/etc/dnsmasq.d/"
];
environment = {
ServerIP = "192.168.1.2";
};
extraDockerOptions = [
"--cap-add=NET_ADMIN"
"--dns=127.0.0.1"
"--dns=1.1.1.1"
];
workdir = "/var/lib/pihole/";
};
};
}