1
0
Fork 0
mirror of https://git.sr.ht/~roxwize/.dotfiles synced 2025-03-14 08:23:25 +00:00
This commit is contained in:
Rae 5e 2025-03-07 21:21:47 -05:00
parent 923a163786
commit 9e407cd78f
Signed by: rae
GPG key ID: 5B1A0FAB9BAB81EE

View file

@ -3,21 +3,29 @@
in with lib; { in with lib; {
options.r5e.containers.pihole = { options.r5e.containers.pihole = {
enable = mkEnableOption "pihole"; enable = mkEnableOption "pihole";
openFirewall = mkOption {
type = types.bool;
default = false;
};
api-password = mkOption { api-password = mkOption {
type = types.string; type = types.str;
default = ""; default = "";
}; };
}; };
config = mkIf cfg.enable mkMerge [ config = mkIf cfg.enable (mkMerge [
(import ./docker-compose.nix { inherit pkgs lib; }) (import ./docker-compose.nix { inherit pkgs lib; })
{ {
virtualisation.oci-containers.containers.pihole = { virtualisation.oci-containers.containers.pihole = {
environment = { environment = {
TZ = config.time.timeZone; TZ = config.time.timeZone;
FTLCONF_webserver_api_password = mkIf (cfg.api-password != null) cfg.api-password; FTLCONF_webserver_api_password = mkIf (cfg.api-password != "") cfg.api-password;
}; };
}; };
networking.firewall = mkIf cfg.openFirewall {
allowedTCPPorts = [ 53 80 443 ];
};
} }
]; ]);
} }