mirror of
https://git.sr.ht/~roxwize/.dotfiles
synced 2025-03-13 16:03:25 +00:00
~
This commit is contained in:
parent
923a163786
commit
9e407cd78f
1 changed files with 12 additions and 4 deletions
|
@ -3,21 +3,29 @@
|
|||
in with lib; {
|
||||
options.r5e.containers.pihole = {
|
||||
enable = mkEnableOption "pihole";
|
||||
openFirewall = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
};
|
||||
api-password = mkOption {
|
||||
type = types.string;
|
||||
type = types.str;
|
||||
default = "";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable mkMerge [
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
(import ./docker-compose.nix { inherit pkgs lib; })
|
||||
{
|
||||
virtualisation.oci-containers.containers.pihole = {
|
||||
environment = {
|
||||
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 ];
|
||||
};
|
||||
}
|
||||
];
|
||||
]);
|
||||
}
|
Loading…
Add table
Reference in a new issue