Add uxplay service.

This commit is contained in:
Kevin Baensch 2024-11-20 21:23:36 +01:00
parent a9f7fe416f
commit a6fcd247b7
Signed by: derped
GPG key ID: C0F1D326C7626543
3 changed files with 33 additions and 14 deletions

View file

@ -12,20 +12,6 @@
}; };
cron.enable = false; cron.enable = false;
}; };
# udp5353 1024-65535
networking.firewall =
let
range = {
from = 1024;
to = 65535;
};
in
{
allowedUDPPorts = [ 5353 ];
allowedUDPPortRanges = [ range ];
allowedTCPPortRanges = [ range ];
};
networking.dhcpcd.extraConfig = "noarp"; networking.dhcpcd.extraConfig = "noarp";
system.stateVersion = "24.05"; system.stateVersion = "24.05";
} }

View file

@ -31,6 +31,7 @@
"mullvad" "mullvad"
"openssh" "openssh"
"pipewire" "pipewire"
"uxplay"
]; ];
firewall = { firewall = {
enable = true; enable = true;

32
services/uxplay.nix Normal file
View file

@ -0,0 +1,32 @@
{
pkgs,
lib,
config,
...
}:
lib.mkIf (lib.elem "uxplay" config.machine.services) {
systemd.user.services.uxplay = {
enable = true;
wantedBy = [ "graphical-session.target" ];
description = "Uxplay is a GPLv3 open source unix AirPlay2 Mirror server for Linux, macOS, and *BSD.";
serviceConfig = {
Type = "simple";
ConditionEnvironment = "WAYLAND_DISPLAY";
# Currently only running on my raspberry pi (remove -bt709 for use on other machines)
ExecStart = ''${pkgs.uxplay}/bin/uxplay -bt709'';
};
};
networking.firewall =
let
range = {
from = 1024;
to = 65535;
};
in
{
allowedUDPPorts = [ 5353 ];
allowedUDPPortRanges = [ range ];
allowedTCPPortRanges = [ range ];
};
}