feat(nixos): migrate AdGuard to Pikachu

This commit was merged in pull request #205.
This commit is contained in:
2026-10-21 18:51:29 -04:00
parent 94eb132962
commit 1a2a4bd2bd
4 changed files with 446 additions and 0 deletions

View File

@@ -0,0 +1,51 @@
{
config,
lib,
registry,
...
}:
let
cfg = config.guests.adguard;
in
{
options.guests.adguard.adminPasswordHash = lib.mkOption {
type = lib.types.str;
description = "Bcrypt verifier for the AdGuard Home administrator password.";
};
config = lib.mkIf cfg.enable {
assertions = [
{
assertion = cfg.address != null;
message = "guests.adguard.address must identify the AdGuard Home guest.";
}
];
registry.homepage.${config.networking.hostName}.adguard = {
tab = "System";
section = "Network";
name = "AdGuard Home";
description = "Internal DNS";
icon = "adguard-home.svg";
href = "http://${cfg.address}";
};
guests.adguard = {
interior = {
modules.services.adguardhome = {
enable = true;
inherit (cfg) adminPasswordHash;
reverseProxyAddress = registry.address.${config.networking.hostName}."reverse-proxy";
};
services.resolved.settings.Resolve.DNSStubListener = false;
};
limits = {
memory = lib.mkDefault "256M";
cpu = lib.mkDefault "100%";
tasksMax = lib.mkDefault 128;
};
};
};
}