flakes/modules/nixos/services/homebridge/default.nix
Chinmay D. Pai 3a3a8afe30
feat: add nixos configuration based on snowfall-lib
Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
2024-09-02 18:31:19 +05:30

47 lines
1.1 KiB
Nix

{ config, lib, ... }:
{
options.snowflake.services.homebridge.enable = lib.mkEnableOption "Enable homebridge service for Apple HomeKit";
config = lib.mkIf config.snowflake.services.homebridge.enable {
networking.firewall = lib.mkIf config.networking.firewall.enable {
allowedTCPPorts = [
5353
8581
51241
];
allowedTCPPortRanges = [
{
from = 52100;
to = 52150;
}
];
allowedUDPPorts = [
5353
8581
51241
];
allowedUDPPortRanges = [
{
from = 52100;
to = 52150;
}
];
};
virtualisation.oci-containers.containers.homebridge = {
image = "docker.io/homebridge/homebridge:latest";
volumes = [ "/var/lib/homebridge:/homebridge" ];
environment = {
TZ = config.time.timeZone;
};
ports = [ "8581:8581" ];
extraOptions = [
"--privileged"
"--net=host"
# For podman
"label=io.containers.autoupdate=registry"
];
};
};
}