Add pihole docker container
This commit is contained in:
36
modules/containers.nix
Normal file
36
modules/containers.nix
Normal 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/";
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user