work on sound broadcasting infra
This commit is contained in:
parent
07e3d5b586
commit
e74bdefc73
|
@ -1,6 +1,4 @@
|
||||||
{ config, lib, ... }:
|
{ config, lib, ... }: {
|
||||||
|
|
||||||
{
|
|
||||||
services.blueman-applet.enable = true;
|
services.blueman-applet.enable = true;
|
||||||
services.mpris-proxy.enable = true;
|
services.mpris-proxy.enable = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,21 @@
|
||||||
{ pkgs, lib, ... }: {
|
{ pkgs, lib, tree, ... }: {
|
||||||
environment.systemPackages = with pkgs; [ mpc_cli ];
|
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 = {
|
hardware.pulseaudio = {
|
||||||
systemWide = true;
|
extraConfig = ''
|
||||||
enable = true;
|
# 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 = {
|
services.mpd = {
|
||||||
enable = true;
|
enable = true;
|
||||||
network.listenAddress = "0.0.0.0";
|
network.listenAddress = "0.0.0.0";
|
||||||
|
@ -33,12 +42,14 @@
|
||||||
}
|
}
|
||||||
audio_output {
|
audio_output {
|
||||||
type "pulse"
|
type "pulse"
|
||||||
name "Out"
|
name "Lappy Out"
|
||||||
server "lappy.tailscale-internal.genderfucked.monster"
|
target "rtp-lappy"
|
||||||
|
server "127.0.0.1"
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
systemd.services.mpd.serviceConfig.After = ["pulseaudio.service"];
|
||||||
systemd.services.mpd.serviceConfig.StateDirectory = [ "/mpd" ];
|
systemd.services.mpd.serviceConfig.StateDirectory = [ "/mpd" ];
|
||||||
|
|
||||||
services.nginx.virtualHosts."stream.owo.monster" = {
|
services.nginx.virtualHosts."stream.owo.monster" = {
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
profiles.connectivity.network_manager
|
profiles.connectivity.network_manager
|
||||||
profiles.connectivity.ios
|
profiles.connectivity.ios
|
||||||
|
|
||||||
profiles.sound.pulseaudio
|
profiles.sound.pulseaudio.pulse
|
||||||
|
|
||||||
profiles.gui
|
profiles.gui
|
||||||
profiles.gui.environments.sway
|
profiles.gui.environments.sway
|
||||||
|
|
|
@ -1,12 +1,10 @@
|
||||||
{ pkgs, tree, ... }: {
|
{ 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 = {
|
environment.systemPackages = with pkgs; [ mpc_cli roc-toolkit ];
|
||||||
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 ];
|
|
||||||
|
|
||||||
systemd.tmpfiles.rules = [
|
systemd.tmpfiles.rules = [
|
||||||
"d /var/lib/mpd 0755 mpd mpd -"
|
"d /var/lib/mpd 0755 mpd mpd -"
|
||||||
|
|
|
@ -10,6 +10,7 @@ let
|
||||||
"hosts/*/profiles".functor.enable = true;
|
"hosts/*/profiles".functor.enable = true;
|
||||||
"profiles/*".functor.enable = true;
|
"profiles/*".functor.enable = true;
|
||||||
"profiles/sound/*".functor.enable = true;
|
"profiles/sound/*".functor.enable = true;
|
||||||
|
"profiles/sound/pulseaudio/*".functor.enable = true;
|
||||||
"profiles/connectivity/*".functor.enable = true;
|
"profiles/connectivity/*".functor.enable = true;
|
||||||
"profiles/gaming/*".functor.enable = true;
|
"profiles/gaming/*".functor.enable = true;
|
||||||
"profiles/gui/environments/*".functor.enable = true;
|
"profiles/gui/environments/*".functor.enable = true;
|
||||||
|
|
|
@ -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 ];
|
|
||||||
}
|
|
11
profiles/sound/pulseaudio/pulse-bluetooth.nix
Normal file
11
profiles/sound/pulseaudio/pulse-bluetooth.nix
Normal 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";
|
||||||
|
};
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
{ ... }: {
|
||||||
|
hardware.pulseaudio = {
|
||||||
|
extraConfig = ''
|
||||||
|
load-module module-native-protocol-tcp auth-anonymous=1 auth-ip-acl=127.0.0.1;
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
7
profiles/sound/pulseaudio/pulse-recv-rtp.nix
Normal file
7
profiles/sound/pulseaudio/pulse-recv-rtp.nix
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
{ ... }: {
|
||||||
|
hardware.pulseaudio = {
|
||||||
|
extraConfig = ''
|
||||||
|
load-module module-rtp-recv latency_msec=50 sap_address=0.0.0.0
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
7
profiles/sound/pulseaudio/pulse-systemwide.nix
Normal file
7
profiles/sound/pulseaudio/pulse-systemwide.nix
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
{tree, ...}: {
|
||||||
|
imports = with tree; [ profiles.sound.pulseaudio.pulse ];
|
||||||
|
hardware.pulseaudio = {
|
||||||
|
systemWide = true;
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
}
|
7
profiles/sound/pulseaudio/pulse.nix
Normal file
7
profiles/sound/pulseaudio/pulse.nix
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
{ config, pkgs, ... }: {
|
||||||
|
sound.enable = true;
|
||||||
|
nixpkgs.config.pulseaudio = true;
|
||||||
|
hardware.pulseaudio = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue