1{
2 config,
3 lib,
4 pkgs,
5 ...
6}:
7let
8 cfg = config.programs.fcast-receiver;
9in
10{
11 meta = {
12 maintainers = pkgs.fcast-receiver.meta.maintainers;
13 };
14
15 options.programs.fcast-receiver = {
16 enable = lib.mkEnableOption "FCast Receiver";
17 openFirewall = lib.mkOption {
18 type = lib.types.bool;
19 default = false;
20 description = ''
21 Open ports needed for the functionality of the program.
22 '';
23 };
24 package = lib.mkPackageOption pkgs "fcast-receiver" { };
25 };
26
27 config = lib.mkIf cfg.enable {
28 environment.systemPackages = [ cfg.package ];
29 networking.firewall = lib.mkIf cfg.openFirewall {
30 allowedTCPPorts = [ 46899 ];
31 };
32 };
33}