about summary refs log tree commit diff
path: root/nixos/modules/programs/fcast-receiver.nix
blob: 8da07a66e22234f32a55db15e5172b31b09d0c1a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{ config, lib, pkgs, ... }:

with lib;

let
  cfg = config.programs.fcast-receiver;
in
{
  meta = {
    maintainers = pkgs.fcast-receiver.meta.maintainers;
  };

  options.programs.fcast-receiver = {
    enable = mkEnableOption (lib.mdDoc "FCast Receiver");
    openFirewall = mkOption {
      type = types.bool;
      default = false;
      description = lib.mdDoc ''
        Open ports needed for the functionality of the program.
      '';
    };
    package = mkPackageOption pkgs "fcast-receiver" { };
  };

  config = mkIf cfg.enable {
    environment.systemPackages = [ cfg.package ];
    networking.firewall = mkIf cfg.openFirewall {
      allowedTCPPorts = [ 46899 ];
    };
  };
}