pihole-ftl: fix useDnsmasqConfig = true and add test (#434351)

This commit is contained in:
Sandro
2025-11-26 14:37:40 +00:00
committed by GitHub
5 changed files with 29 additions and 4 deletions
@@ -118,6 +118,8 @@ in
configFile = lib.mkOption {
type = lib.types.package;
readOnly = true;
default = dnsmasqConf;
defaultText = lib.literalExpression "Path of dnsmasq config file";
description = ''
Path to the configuration file of dnsmasq.
'';
@@ -137,8 +139,6 @@ in
conf-file = lib.mkDefault (lib.optional cfg.resolveLocalQueries "/etc/dnsmasq-conf.conf");
resolv-file = lib.mkDefault (lib.optional cfg.resolveLocalQueries "/etc/dnsmasq-resolv.conf");
};
configFile = dnsmasqConf;
};
networking.nameservers = lib.optional cfg.resolveLocalQueries "127.0.0.1";
+1
View File
@@ -2,4 +2,5 @@
{
basic = runTest ./basic.nix;
dnsmasq = runTest ./dnsmasq.nix;
}
+20
View File
@@ -0,0 +1,20 @@
let
port = "9077";
in
{
name = "pihole-ftl-dnsmasq";
nodes.machine = {
services.pihole-ftl = {
enable = true;
useDnsmasqConfig = true;
settings.webserver.port = port;
};
};
testScript = ''
start_all()
machine.wait_for_unit("pihole-ftl.service")
machine.wait_for_open_port(${port})
'';
}
+1
View File
@@ -106,6 +106,7 @@ stdenv.mkDerivation rec {
inherit (nixosTests) dnscrypt-proxy;
kubernetes-dns-single = nixosTests.kubernetes.dns-single-node;
kubernetes-dns-multi = nixosTests.kubernetes.dns-multi-node;
pihole-ftl-dnsmasq = nixosTests.pihole-ftl.dnsmasq;
};
meta = with lib; {
+5 -2
View File
@@ -77,8 +77,11 @@ stdenv.mkDerivation (finalAttrs: {
runHook postInstall
'';
passthru.settingsTemplate = ./pihole.toml;
passthru.tests = nixosTests.pihole-ftl;
passthru = {
settingsTemplate = ./pihole.toml;
tests = nixosTests.pihole-ftl;
};
meta = {
description = "Pi-hole FTL engine";