From a6bdd96a867045b30a7e6df157e2f501a20e1cfd Mon Sep 17 00:00:00 2001 From: Ivan Bushchik Date: Sat, 6 Jan 2024 13:20:32 +0300 Subject: [PATCH] roles: Add airplay-server role (pkg + open ports) Signed-off-by: Ivan Bushchik --- roles/airplay-server.nix | 12 ++++++++++++ roles/default.nix | 1 + 2 files changed, 13 insertions(+) create mode 100644 roles/airplay-server.nix diff --git a/roles/airplay-server.nix b/roles/airplay-server.nix new file mode 100644 index 0000000..85e1d82 --- /dev/null +++ b/roles/airplay-server.nix @@ -0,0 +1,12 @@ +{ config, pkgs, lib, ... }: + +let cfg = config.my.roles.airplay-server; +in { + options.my.roles.airplay-server.enable = + lib.mkEnableOption "Enable uxplay and open ports"; + config = lib.mkIf (cfg.enable) { + environment.systemPackages = with pkgs; [ uxplay ]; + networking.firewall.allowedUDPPorts = [ 6000 6001 7011 ]; + networking.firewall.allowedTCPPorts = [ 7000 7001 7100 ]; + }; +} diff --git a/roles/default.nix b/roles/default.nix index 170ff92..2c372b7 100644 --- a/roles/default.nix +++ b/roles/default.nix @@ -1,5 +1,6 @@ { imports = [ + ./airplay-server.nix ./design.nix ./devel.nix ./gaming.nix