3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #148049 from hexagonal-sun/shairport-firewall-rules

nixos/shairport-sync: add firewall rules
This commit is contained in:
Aaron Andersen 2021-12-02 15:21:28 -05:00 committed by GitHub
commit ac573f3975
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -36,6 +36,14 @@ in
'';
};
openFirewall = mkOption {
type = types.bool;
default = false;
description = ''
Whether to automatically open ports in the firewall.
'';
};
user = mkOption {
type = types.str;
default = "shairport";
@ -66,6 +74,12 @@ in
extraGroups = [ "audio" ] ++ optional config.hardware.pulseaudio.enable "pulse";
};
networking.firewall = mkIf cfg.openFirewall {
allowedTCPPorts = [ 5000 ];
allowedUDPPortRanges = [ { from = 6001; to = 6011; } ];
};
systemd.services.shairport-sync =
{
description = "shairport-sync";