-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a module for pihole-ftl, which allows declaratively defining the setupVars.conf and pihole-FTL.conf configuration files. Also provide options for adlists to use, which can be added through the pihole script (packaged as "pihole"). Other state such as clients and groups require complex database operations, which is normally performed by the pihole admin webapp (packaged as "pihole-admin"). Extend the dnsmasq module to avoid duplication, since pihole-ftl is a soft-fork of dnsmasq which maintains compatibility. Provide the pihole script in `environment.systemPackages` so pihole-ftl can be easily administrated.
- Loading branch information
1 parent
d29a0f9
commit c244a3d
Showing
4 changed files
with
506 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# pihole-FTL {#module-services-networking-pihole-ftl} | ||
|
||
*Upstream documentation*: <https://docs.pi-hole.net/ftldns/> | ||
|
||
pihole-FTL is a fork of [Dnsmasq](#module-services-networking-dnsmasq), | ||
providing some additional features, including an API for analysis and | ||
statistics. | ||
|
||
This module uses the configuration [options of the Dnsmasq | ||
module](#module-services-networking-dnsmasq). | ||
Note that pihole-FTL and Dnsmasq cannot be enabled at | ||
the same time. | ||
|
||
## Configuration {#module-services-networking-pihole-configuration} | ||
|
||
See the [Dnsmasq | ||
example](#module-services-networking-dnsmasq-configuration-home) for the | ||
required Dnsmasq configuration. Make sure to set | ||
[](#opt-services.dnsmasq.enable) to false and | ||
[](#opt-services.pihole-ftl.enable) to true instead: | ||
|
||
```nix | ||
{ | ||
services.pihole-ftl = { | ||
enable = true; | ||
adlists = [ | ||
{ | ||
url = "https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts"; | ||
comment = "Steven Black's unified adlist"; | ||
} | ||
]; | ||
extraSetupVars = { | ||
API_QUERY_LOG_SHOW = "blockedonly"; | ||
}; | ||
}; | ||
} | ||
``` | ||
|
||
## Administration {#module-services-networking-pihole-ftl-administration} | ||
|
||
*pihole command documentation*: <https://docs.pi-hole.net/core/pihole-command> | ||
|
||
Enabling pihole-FTL provides the `pihole` command, which can be used to control | ||
the daemon and the configuration database in `/etc/pihole/`. This includes | ||
blocking/allowing specific URLs, and adding adlists, e.g. **pihole -a adlist add | ||
https://example.com/adlist.txt**. | ||
|
||
Note that in NixOS the script has been patched to remove the reinstallation, | ||
update, and Dnsmasq configuration commands. In NixOS, Pi-hole's configuration is | ||
immutable and must be done with NixOS options. | ||
|
||
For more convenient administration and monitoring, see [Pi-hole | ||
Dashboard](#module-services-web-apps-pihole-web) |
Oops, something went wrong.