work on sound broadcasting infra

This commit is contained in:
ChaotiCryptidz 2022-01-25 12:15:56 +00:00
parent 07e3d5b586
commit e74bdefc73
11 changed files with 65 additions and 30 deletions

View file

@ -1,6 +1,4 @@
{ config, lib, ... }:
{
{ config, lib, ... }: {
services.blueman-applet.enable = true;
services.mpris-proxy.enable = true;
}

View file

@ -1,12 +1,21 @@
{ pkgs, lib, ... }: {
environment.systemPackages = with pkgs; [ mpc_cli ];
{ pkgs, lib, tree, ... }: {
imports = with tree; [
# systemwide pulseaudio w/ recv native localhost
# to broadcast to all speakers over rtp
profiles.sound.pulseaudio.pulse-systemwide
profiles.sound.pulseaudio.pulse-recv-native-localhost
];
sound.enable = true;
hardware.pulseaudio = {
systemWide = true;
enable = true;
extraConfig = ''
# laptop
load-module module-null-sink sink_name=rtp-lappy sink_properties="device.description='Laptop Output'"
load-module module-rtp-send source=rtp-lappy.monitor destination_ip=100.115.10.34
'';
};
environment.systemPackages = with pkgs; [ mpc_cli ];
services.mpd = {
enable = true;
network.listenAddress = "0.0.0.0";
@ -33,12 +42,14 @@
}
audio_output {
type "pulse"
name "Out"
server "lappy.tailscale-internal.genderfucked.monster"
name "Lappy Out"
target "rtp-lappy"
server "127.0.0.1"
}
'';
};
systemd.services.mpd.serviceConfig.After = ["pulseaudio.service"];
systemd.services.mpd.serviceConfig.StateDirectory = [ "/mpd" ];
services.nginx.virtualHosts."stream.owo.monster" = {

View file

@ -18,7 +18,7 @@
profiles.connectivity.network_manager
profiles.connectivity.ios
profiles.sound.pulseaudio
profiles.sound.pulseaudio.pulse
profiles.gui
profiles.gui.environments.sway

View file

@ -1,12 +1,10 @@
{ pkgs, tree, ... }: {
imports = [ ./mpd-music-sync.nix ];
imports = [ ./mpd-music-sync.nix ] ++ (with tree; [
profiles.sound.pulseaudio.pulse-recv-native-localhost
profiles.sound.pulseaudio.pulse-recv-rtp
]);
hardware.pulseaudio = {
extraConfig =
"load-module module-native-protocol-tcp auth-anonymous=1 auth-ip-acl=127.0.0.1;100.64.0.0/8";
};
environment.systemPackages = with pkgs; [ mpc_cli ];
environment.systemPackages = with pkgs; [ mpc_cli roc-toolkit ];
systemd.tmpfiles.rules = [
"d /var/lib/mpd 0755 mpd mpd -"

View file

@ -10,6 +10,7 @@ let
"hosts/*/profiles".functor.enable = true;
"profiles/*".functor.enable = true;
"profiles/sound/*".functor.enable = true;
"profiles/sound/pulseaudio/*".functor.enable = true;
"profiles/connectivity/*".functor.enable = true;
"profiles/gaming/*".functor.enable = true;
"profiles/gui/environments/*".functor.enable = true;

View file

@ -1,12 +0,0 @@
{ config, pkgs, ... }: {
sound.enable = true;
nixpkgs.config.pulseaudio = true;
hardware.pulseaudio = {
enable = true;
#support32Bit = true;
extraModules = with pkgs; [ pkgs.pulseaudio-modules-bt ];
package = pkgs.pulseaudioFull;
extraConfig = "\n load-module module-switch-on-connect\n ";
};
environment.systemPackages = with pkgs; [ pavucontrol ];
}

View file

@ -0,0 +1,11 @@
{ pkgs, tree, lib, ... }: {
imports = with tree; [
profiles.connectivity.bluetooth
];
hardware.pulseaudio = {
extraModules = with pkgs; [ pkgs.pulseaudio-modules-bt ];
package = lib.mkForce pkgs.pulseaudioFull;
extraConfig = "load-module module-switch-on-connect";
};
}

View file

@ -0,0 +1,7 @@
{ ... }: {
hardware.pulseaudio = {
extraConfig = ''
load-module module-native-protocol-tcp auth-anonymous=1 auth-ip-acl=127.0.0.1;
'';
};
}

View file

@ -0,0 +1,7 @@
{ ... }: {
hardware.pulseaudio = {
extraConfig = ''
load-module module-rtp-recv latency_msec=50 sap_address=0.0.0.0
'';
};
}

View file

@ -0,0 +1,7 @@
{tree, ...}: {
imports = with tree; [ profiles.sound.pulseaudio.pulse ];
hardware.pulseaudio = {
systemWide = true;
enable = true;
};
}

View file

@ -0,0 +1,7 @@
{ config, pkgs, ... }: {
sound.enable = true;
nixpkgs.config.pulseaudio = true;
hardware.pulseaudio = {
enable = true;
};
}