Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pihole-ftl: init at 5.8.1 #108055

Closed
wants to merge 2 commits into from
Closed

Conversation

JamieMagee
Copy link
Member

Motivation for this change

The first part of a trio of PRs (to be followed by pihole and pihole-admin). Based on the work of @nuxeh and the pi-hole-ftl Arch Linux package

#61617

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

pkgs/tools/networking/pihole-ftl/cmake.patch Outdated Show resolved Hide resolved
pkgs/tools/networking/pihole-ftl/default.nix Outdated Show resolved Hide resolved
pkgs/tools/networking/pihole-ftl/default.nix Outdated Show resolved Hide resolved
pkgs/tools/networking/pihole-ftl/default.nix Outdated Show resolved Hide resolved
pkgs/tools/networking/pihole-ftl/default.nix Show resolved Hide resolved
pkgs/tools/networking/pihole-ftl/version.patch Outdated Show resolved Hide resolved
@SuperSandro2000
Copy link
Member

This is a semi-automatic executed nixpkgs-review which does not build all packages (e.g. lumo, tensorflow or pytorch)
If you find some bugs or got suggestions for further things to search or run please reach out to SuperSandro2000 on IRC.

Result of nixpkgs-review pr 108055 run on x86_64-darwin 1

1 package failed to build and are new build failure:

@SuperSandro2000
Copy link
Member

This is a semi-automatic executed nixpkgs-review which does not build all packages (e.g. lumo, tensorflow or pytorch)
If you find some bugs or got suggestions for further things to search or run please reach out to SuperSandro2000 on IRC.

Result of nixpkgs-review pr 108055 run on x86_64-linux 1

1 package blacklisted:
  • tests.nixos-functions.nixos-test
1 package built:
  • pihole-ftl

@JamieMagee
Copy link
Member Author

I will mark this package as linux only. Fixes for mac should be made upstream.

@JamieMagee JamieMagee force-pushed the pihole-ftl branch 2 times, most recently from 23b5611 to bdf09cc Compare March 28, 2021 02:57
@JamieMagee JamieMagee changed the title pihole-ftl: init at 5.3.4 pihole-ftl: init at 5.7 Mar 28, 2021
@JamieMagee
Copy link
Member Author

@SuperSandro2000 Ready for re-review

@lunik1 lunik1 mentioned this pull request Apr 24, 2021
10 tasks
Copy link
Member

@cole-h cole-h left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I look forward to getting this into Nixpkgs so I can ditch my old Pi that's showing its age :)

nixos/modules/services/networking/pihole-ftl.nix Outdated Show resolved Hide resolved
pkgs/tools/networking/pihole-ftl/default.nix Outdated Show resolved Hide resolved
pkgs/tools/networking/pihole-ftl/default.nix Show resolved Hide resolved
pkgs/tools/networking/pihole-ftl/default.nix Outdated Show resolved Hide resolved
@JamieMagee JamieMagee changed the title pihole-ftl: init at 5.7 pihole-ftl: init at 5.8.1 May 18, 2021
Copy link
Contributor

@Mindavi Mindavi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, haven't tested this though.

@JamieMagee
Copy link
Member Author

@cole-h I think this iteration is ready for review.

@cole-h
Copy link
Member

cole-h commented May 27, 2021

Great! Unfortunately, I'm a bit swamped at the moment... I'll be able to take a look Monday at the earliest. Sorry for the inconvenience.

@JamieMagee
Copy link
Member Author

Not a problem. I know the feeling 😅. This PR has been open for a while, so there's no rush!

assertions = [
{
assertion = !config.services.dnsmasq.enable;
message = "pihole-ftl conflicts with dnsmasq";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
message = "pihole-ftl conflicts with dnsmasq";
message = "pihole-ftl conflicts with dnsmasq. Please disable one of them.";

let

cfg = config.services.pihole-ftl;
stateDir = "/etc/pihole";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨

When we start calling variables that point to /etc by stateDir in NixOS the red alert sirens start up. Generally people in the NixOS community aren't a fan of using configuration directories for state.

You have a problem, though. It appears this software is very stubborn when it comes to doing almost everything NixOS doesn't want software to do. Just take a look at this.

Can we use RootDirectory to shoehorn this service into its own space?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is pretty common to edit the config values for pihole over the web interface. That wouldn't really work on nixos.

Also it regularly updates blocklists which need to go there.

systemd.tmpfiles.rules = [
"d ${stateDir} 0700 pihole pihole - -"
"L+ ${confFile} - - - - ${confText}"
"f ${logFile} 0700 pihole pihole - -"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this grow indefinitely until the system it runs on comes to a crash from lack of disk space?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw a number of mentions about log rotation, so maybe the old files need to be deleted. NixOS has a module for that, if needed.

Copy link
Member

@cole-h cole-h left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Diff LGTM, but I'm gonna try and run it to make sure everything looks good before giving the green checkmark.

owner = "pi-hole";
repo = "FTL";
rev = "v${version}";
sha512 = "1ybf71jwr781c7q3xvjla2vhnarba6dpp94ghzd31vhdc038g36f0ad2xp3hh8bk1hmlwzzqpcd5pl23w0f4b19kgms4cbk8rh6nvpr";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason why you chose sha512? Nixpkgs usually defaults to sha256.

It doesn't matter (I don't think); just curious.

substituteInPlace src/version.h.in \
--replace "@GIT_VERSION@" "v${version}" \
--replace "@GIT_DATE@" "1970-01-01" \
--replace "@GIT_BRANCH@" "master" \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd also change this to v${version}.

@Kranzes
Copy link
Member

Kranzes commented Aug 5, 2021

Any updates on the current state of this PR?

@JamieMagee
Copy link
Member Author

@Kranzes I haven't had a chance to work on this PR recently. I think it is relatively close, so feel free to pick up the remaining work to get it merged.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 19, 2022
@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Oct 14, 2022
@SuperSandro2000 SuperSandro2000 added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Oct 14, 2022
@SuperSandro2000
Copy link
Member

I would really like to get pihole into nixpkgs but I think it won't be easy and almost not feasible because it assumes almost everywhere writable FHS directories like https://github.com/pi-hole/pi-hole/blob/master/advanced/Scripts/piholeLogFlush.sh

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Oct 14, 2022
@JamieMagee
Copy link
Member Author

Closing this PR as I don't intend to continue with it. I'll leave the branch around if anyone wants to pick up where I left off.

@JamieMagee JamieMagee closed this Dec 18, 2022
@williamvds
Copy link
Contributor

williamvds commented Mar 8, 2023

For those who may be interested, I'm currently picking up this work. For now it lives in my personal Flake.
I've got pihole-ftl running alongside the Admin UI in a mostly functional and declarative state. I'll raise a draft PR once I've ironed out more of the kinks.

@williamvds williamvds mentioned this pull request Apr 5, 2023
15 tasks
@JamieMagee JamieMagee deleted the pihole-ftl branch September 3, 2023 05:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants