31 lines
783 B
Nix
31 lines
783 B
Nix
{ inputs, config, lib, pkgs, ... }:
|
|
let
|
|
cfg = config.services.asterisk-phony;
|
|
in
|
|
{
|
|
imports = [
|
|
];
|
|
|
|
options.services.asterisk-phony = {
|
|
enable = lib.mkOption {
|
|
type = with lib.types; uniq bool;
|
|
default = false;
|
|
description = "Enable Asterisk Communication";
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
services.asterisk = {
|
|
# See Configuration Options: https://search.nixos.org/options?channel=unstable&type=options&query=asterisk
|
|
enable = true;
|
|
confFiles = {
|
|
"pjsip.conf" = builtins.readFile ./pjsip.conf;
|
|
"extensions.conf" = builtins.readFile ./extensions.conf;
|
|
};
|
|
};
|
|
|
|
# Firewall
|
|
networking.firewall.allowedTCPPorts = [ 8088 8089 ];
|
|
# networking.firewall.allowedUDPPorts = [ ... ];
|
|
};
|
|
}
|