neptune: lan hosts can stream audio to speakers
This commit is contained in:
@@ -169,6 +169,17 @@
|
||||
};
|
||||
roles.default.machines.b4l = { };
|
||||
};
|
||||
pulse-stream = {
|
||||
module = {
|
||||
name = "pulse-stream";
|
||||
input = "self";
|
||||
};
|
||||
roles.default.machines.neptune = {
|
||||
settings.client-ip-ranges = [
|
||||
"10.0.0.0/24"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
43
modules/clan/pulse-stream/default.nix
Normal file
43
modules/clan/pulse-stream/default.nix
Normal file
@@ -0,0 +1,43 @@
|
||||
{ ... }:
|
||||
{
|
||||
_class = "clan.service";
|
||||
manifest.name = "pulse-stream";
|
||||
manifest.description = "stream audio to attached speakers";
|
||||
manifest.categories = [ "System" ];
|
||||
|
||||
roles.default = {
|
||||
interface =
|
||||
{ lib, ... }:
|
||||
{
|
||||
options.client-ip-ranges = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
description = "ip subnets permitted to stream to the server";
|
||||
default = [];
|
||||
};
|
||||
};
|
||||
perInstance =
|
||||
{
|
||||
roles,
|
||||
settings,
|
||||
...
|
||||
}:
|
||||
{
|
||||
nixosModule =
|
||||
{ ... }:
|
||||
{
|
||||
services.pulseaudio = {
|
||||
enable = true;
|
||||
systemWide = true;
|
||||
tcp = {
|
||||
enable = true;
|
||||
anonymousClients.allowedIpRanges =
|
||||
settings.client-ip-ranges;
|
||||
anonymousClients.allowAll = true;
|
||||
};
|
||||
zeroconf.publish.enable = true;
|
||||
};
|
||||
networking.firewall.allowedTCPPorts = [ 4713 ];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
9
modules/clan/pulse-stream/flake-module.nix
Normal file
9
modules/clan/pulse-stream/flake-module.nix
Normal file
@@ -0,0 +1,9 @@
|
||||
{ lib, ... }:
|
||||
let
|
||||
module = lib.modules.importApply ./default.nix { };
|
||||
in
|
||||
{
|
||||
clan.modules = {
|
||||
pulse-stream = module;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user