schmittlauch.audio-sharing: init module

This commit is contained in:
Trolli Schmittlauch 2026-01-15 11:48:52 +01:00
parent 5251774f9d
commit 289bb07cc2
3 changed files with 35 additions and 0 deletions

32
common/audio-sharing.nix Normal file
View file

@ -0,0 +1,32 @@
{
config,
pkgs,
lib,
...
}:
let
cfg = config.schmittlauch.audio-sharing;
fwPort = 8554;
in
{
options.schmittlauch.audio-sharing = {
enable = lib.mkEnableOption "enable Gnome audio-sharing application via rtsp";
openFirewall = lib.mkOption {
default = true;
type = lib.types.bool;
description = "Opens the port ${toString fwPort} to allow access to the rtsp stream";
};
};
config = lib.mkMerge [
(lib.mkIf cfg.enable {
environment.systemPackages = [ pkgs.audio-sharing ];
})
(lib.mkIf (cfg.enable && cfg.openFirewall) {
networking.firewall = {
allowedUDPPorts = [ fwPort ];
allowedTCPPorts = [ fwPort ];
};
})
];
}