{ pkgs, lib, config, ... }:
let
  cfg = config.mods.server.nvr;
  # port = config.mods.server.nginx.ports.vault;
in with lib; {
  options.mods.server = {
    nvr = {
      enable = mkEnableOption {
        default = false;
        description = "enables zoneminder server";
      };
    };
  };

  config = mkIf cfg.enable {
    services.zoneminder = {
      enable = true;
      openFirewall = true;
      database = {
        createLocally = true;
        username = "zoneminder";
      };
    };
  };
}
