From 76a8a4c9e3d75171572a64bf7209acd4454a76bf Mon Sep 17 00:00:00 2001 From: kjubybot Date: Sat, 7 Mar 2026 23:17:54 +0100 Subject: [PATCH] pihole: 6.1.4 -> 6.4 --- pkgs/by-name/pi/pihole/0001-Remove-sudo.patch | 25 ++++++++++--------- pkgs/by-name/pi/pihole/package.nix | 18 ++++++------- 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/pkgs/by-name/pi/pihole/0001-Remove-sudo.patch b/pkgs/by-name/pi/pihole/0001-Remove-sudo.patch index f10afba82490..8530e00eac05 100644 --- a/pkgs/by-name/pi/pihole/0001-Remove-sudo.patch +++ b/pkgs/by-name/pi/pihole/0001-Remove-sudo.patch @@ -1,32 +1,33 @@ -From 833856bd77dc6ea77557ab0659c1459bee393653 Mon Sep 17 00:00:00 2001 +From 16f94593a18e7a0668df6ed9d4744252185e5876 Mon Sep 17 00:00:00 2001 From: averyv -Date: Sat, 6 Sep 2025 17:51:48 +0100 +Date: Sat, 6 Sep 2025 18:04:11 +0100 Subject: [PATCH 1/2] Remove sudo Rely on polkit and sensible permissions --- - pihole | 8 -------- - 1 file changed, 8 deletions(-) + pihole | 9 --------- + 1 file changed, 9 deletions(-) diff --git a/pihole b/pihole -index 7b5e3eb..b00617e 100755 +index 5af46fa6..96acb1ae 100755 --- a/pihole +++ b/pihole -@@ -570,14 +570,6 @@ if [[ -z ${USER} ]]; then +@@ -587,15 +587,6 @@ if [[ -z ${USER} ]]; then USER=$(whoami) fi - + -# Check if the current user is not root and if the command -# requires root. If so, exit with an error message. --if [[ $EUID -ne 0 && need_root -eq 1 ]];then -- echo -e " ${CROSS} The Pi-hole command requires root privileges, try:" +-# Add an exception for the user "pihole" to allow the webserver running gravity +-if [[ ( $EUID -ne 0 && ${USER} != "pihole" ) && -n "${need_root}" ]]; then +- echo -e " ${CROSS} This Pi-hole command requires root privileges, try:" - echo -e " ${COL_GREEN}sudo pihole $*${COL_NC}" - exit 1 -fi - # Handle redirecting to specific functions based on arguments case "${1}" in - "allow" | "allowlist" ) listFunc "$@";; --- -2.50.1 + "-d" | "debug" ) debugFunc "$@";; +-- +2.50.1 (Apple Git-155) diff --git a/pkgs/by-name/pi/pihole/package.nix b/pkgs/by-name/pi/pihole/package.nix index 93b327eae971..aab0932a9874 100644 --- a/pkgs/by-name/pi/pihole/package.nix +++ b/pkgs/by-name/pi/pihole/package.nix @@ -32,13 +32,13 @@ (resholve.mkDerivation rec { pname = "pihole"; - version = "6.1.4"; + version = "6.4"; src = fetchFromGitHub { owner = "pi-hole"; repo = "pi-hole"; tag = "v${version}"; - hash = "sha256-2B2GUJKt4jHEjQLBx96FRuHpnLCTzE4UPDaeQvnDONc="; + hash = "sha256-aBQO+wAqeuXc9ekByVFlOZQ9SBCGsozGdoS8r1qhGuk="; }; patches = [ @@ -61,11 +61,11 @@ install -Dm 555 -t $out/bin pihole install -Dm 555 -t $scriptsDir/advanced/Scripts gravity.sh - # The installation script is sourced by advanced/Scripts/piholeARPTable.sh etc + # The installation script is sourced by advanced/Scripts/piholeDebug.sh etc cp --parents -r -t $scriptsDir/ 'automated install/' advanced/{Scripts,Templates}/ installShellCompletion --bash --name pihole.bash \ - advanced/bash-completion/pihole + advanced/bash-completion/pihole.bash runHook postInstall ''; @@ -86,10 +86,10 @@ "${relativeScripts}/database_migration/gravity-db.sh" "${relativeScripts}/gravity.sh" "${relativeScripts}/list.sh" - "${relativeScripts}/piholeARPTable.sh" "${relativeScripts}/piholeCheckout.sh" "${relativeScripts}/piholeDebug.sh" "${relativeScripts}/piholeLogFlush.sh" + "${relativeScripts}/piholeNetworkFlush.sh" "${relativeScripts}/query.sh" "${relativeScripts}/update.sh" "${relativeScripts}/updatecheck.sh" @@ -129,6 +129,7 @@ "/etc/os-release" "/etc/pihole/versions" "/etc/pihole/setupVars.conf" + "/opt/pihole/utils.sh" ]; external = [ # Used by chronometer.sh to get GPU information on Raspberry Pis @@ -178,6 +179,7 @@ "/etc/pihole/versions" "/etc/pihole/setupVars.conf" "$cachedVersions" + "/opt/pihole/utils.sh" ]; "$PIHOLE_SETUP_VARS_FILE" = true; @@ -190,9 +192,9 @@ "${scriptsDir}/api.sh" = true; "${scriptsDir}/gravity.sh" = true; "${scriptsDir}/list.sh" = true; - "${scriptsDir}/piholeARPTable.sh" = true; "${scriptsDir}/piholeDebug.sh" = true; "${scriptsDir}/piholeLogFlush.sh" = true; + "${scriptsDir}/piholeNetworkFlush.sh" = true; "${scriptsDir}/query.sh" = true; "${scriptsDir}/uninstall.sh" = true; "${scriptsDir}/update.sh" = true; @@ -241,9 +243,7 @@ passthru.tests = nixosTests.pihole-ftl; - passthru = { - inherit stateDir; - }; + passthru = { inherit stateDir; }; }).overrideAttrs (old: { # Resholve can't fix the hardcoded absolute paths, so substitute them before resholving