feat: docker for pi hole
This commit is contained in:
parent
93942581c6
commit
168b38b49d
1 changed files with 30 additions and 1 deletions
|
|
@ -6,7 +6,9 @@
|
||||||
lib,
|
lib,
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}: {
|
}: let
|
||||||
|
serverIP = 0.0 .0 .0;
|
||||||
|
in {
|
||||||
imports = [
|
imports = [
|
||||||
# Include the results of the hardware scan.
|
# Include the results of the hardware scan.
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
|
|
@ -35,5 +37,32 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
virtualisation.docker.enable = true;
|
||||||
|
virtualisation.oci-containers = {
|
||||||
|
backend = "docker";
|
||||||
|
virtualisation.oci-containers.containers.pihole = {
|
||||||
|
image = "pihole/pihole:latest";
|
||||||
|
ports = [
|
||||||
|
"${serverIP}:53:53/tcp"
|
||||||
|
"${serverIP}:53:53/udp"
|
||||||
|
"3080:80"
|
||||||
|
"30443:443"
|
||||||
|
];
|
||||||
|
volumes = [
|
||||||
|
"/var/lib/pihole/:/etc/pihole/"
|
||||||
|
"/var/lib/dnsmasq.d:/etc/dnsmasq.d/"
|
||||||
|
];
|
||||||
|
environment = {
|
||||||
|
ServerIP = serverIP;
|
||||||
|
};
|
||||||
|
extraOptions = [
|
||||||
|
"--cap-add=NET_ADMIN"
|
||||||
|
"--dns=127.0.0.1"
|
||||||
|
"--dns=1.1.1.1"
|
||||||
|
];
|
||||||
|
workdir = "/var/lib/pihole/";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
system.stateVersion = "24.11";
|
system.stateVersion = "24.11";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue