-
-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
nixos/adguardhome: Add settings option #152029
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left a few very minor suggestions. I hope you agree with them.
I'm not an adguardhome
user but I definitely like what you have done here. Great job adapting software that really wants to be managed imperatively and bending it to the will of nix
in a reasonable way 👍
fdb7cc5
to
a2f69b4
Compare
These changes are really reasonable. Thanks for the input, I tried checking a few options for links and the checked one didn't contain any links (Edit: I meant that they didn't contain any markup for the links). |
a2f69b4
to
846d7e7
Compare
Have you tested this? If so, I'm happy to merge once @lunik1 reviews. Please ping back in a few days if we don't hear anything. |
I already migrated my config to it, using: disabledModules = [ "services/networking/adguardhome.nix" ];
imports = [ ../../nixpkgs/nixos/modules/services/networking/adguardhome.nix ]; # This is a relative path to my nixpkgs checkout Redeploying didn't result in any new closures, so your changes give identical results. |
Perfect! Thanks. |
Sorry for the delay, I really like this PR too. Good work! My one suggestion is that I think it now makes sense to make the config location configurable à la #131356, could you add this option? |
@CRTified nice addition, a lot more refined than my initial PR. |
I think this PR strikes a nice balance because |
@lunik1 @rhoriguchi Do you have a specific use case in mind for making the configuration path configurable? Maybe this can be integrated, but the @aanderse Would it make sense to add a test for the service? I don't see a way to test the |
The proposal your are making works fine for me, I'm not a big fan of the merging of the config, would be nice if that could be controlled by a option. Since i personally want to have an idempotent configuration. I currently solve it like this which is more or less how you do it. |
That's easy enough, by conditionally always |
Maybe I am missing something, but could the target of that |
If the target was a symlink/hardlink, that |
This commit introduces `services.adguardhome.settings` and `services.adguardhome.mutableSettings`. The first option allows declarative configuration of AdGuard Home, while the second one controls whether changes made in the web interface are kept between service restarts. Co-authored-by: Aaron Andersen <[email protected]>
846d7e7
to
24b8c37
Compare
I've now added @rhoriguchi Let me know if this is sufficient for you. @lunik1 I think adding a configurable path would complicate things a lot, as we need to consider whether merging/overriding should happen at all if that configuration is set. I'm also unsure whether the minimal isolation provided by systemd would require some attention for arbitrary config paths. But it appears that when having multiple Please let me know what you think. |
Thank you for adding the option. This is perfect, that way you can ensure that the config is always the same after a restart. I don't really see a reason to add a path since the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 👍
@aanderse I think this can be merged now :) |
Thanks for the ping back! |
Motivation for this change
It was not possible to configure AdGuard declaratively before.
This PR adds
services.adguard.settings
to generate theAdGuardHome.yaml
. It is merged withyaml-merge
on start.Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)nixos/doc/manual/md-to-db.sh
to update generated release notes