mirror of
https://github.com/kmein/niveum
synced 2026-03-19 03:21:10 +01:00
feat(pipewire): try to do some pulseaudio networking stuff
This commit is contained in:
@@ -86,6 +86,7 @@ in {
|
|||||||
hashedPasswordFile = config.age.secrets.kfm-password.path;
|
hashedPasswordFile = config.age.secrets.kfm-password.path;
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
uid = 1000;
|
uid = 1000;
|
||||||
|
extraGroups = ["pipewire" "audio"];
|
||||||
};
|
};
|
||||||
|
|
||||||
age.secrets = {
|
age.secrets = {
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
{pkgs, ...}: {
|
{pkgs, ...}: {
|
||||||
sound.enable = true;
|
sound.enable = true;
|
||||||
|
|
||||||
# realtime audio
|
|
||||||
security.rtkit.enable = true;
|
|
||||||
|
|
||||||
services.pipewire = {
|
services.pipewire = {
|
||||||
enable = true;
|
enable = true;
|
||||||
alsa = {
|
alsa = {
|
||||||
@@ -16,25 +13,19 @@
|
|||||||
|
|
||||||
systemd.user.services.pipewire-pulse.path = [pkgs.pulseaudio];
|
systemd.user.services.pipewire-pulse.path = [pkgs.pulseaudio];
|
||||||
|
|
||||||
hardware.pulseaudio = {
|
services.avahi = {
|
||||||
enable = false;
|
enable = true;
|
||||||
package = pkgs.pulseaudioFull;
|
publish.enable = true;
|
||||||
# copy server:/run/pulse/.config/pulse/cookie to client:~/.config/pulse/cookie to authenticate a client machine
|
publish.userServices = true;
|
||||||
zeroconf.discovery.enable = true;
|
|
||||||
extraConfig = ''
|
|
||||||
load-module ${
|
|
||||||
toString [
|
|
||||||
"module-tunnel-sink-new"
|
|
||||||
"server=zaatar.r"
|
|
||||||
"sink_name=zaatar"
|
|
||||||
"channels=2"
|
|
||||||
"rate=44100"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
|
|
||||||
users.users.me.extraGroups = ["pipewire" "audio"];
|
environment.etc."pipewire/pipewire-pulse.conf.d/50-network-party.conf".text = ''
|
||||||
|
context.exec = [
|
||||||
|
{ path = "pactl" args = "load-module module-native-protocol-tcp" }
|
||||||
|
{ path = "pactl" args = "load-module module-zeroconf-discover" }
|
||||||
|
{ path = "pactl" args = "load-module module-zeroconf-publish" }
|
||||||
|
]
|
||||||
|
'';
|
||||||
|
|
||||||
environment.systemPackages = [
|
environment.systemPackages = [
|
||||||
pkgs.pavucontrol
|
pkgs.pavucontrol
|
||||||
|
|||||||
@@ -12,12 +12,12 @@ in {
|
|||||||
./gaslight.nix
|
./gaslight.nix
|
||||||
./kiosk.nix
|
./kiosk.nix
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
./pulseaudio.nix
|
|
||||||
./home-assistant.nix
|
./home-assistant.nix
|
||||||
./mpd.nix
|
./mpd.nix
|
||||||
./grocy.nix
|
./grocy.nix
|
||||||
./spotifyd.nix
|
./spotifyd.nix
|
||||||
../../configs/keyboard.nix
|
../../configs/keyboard.nix
|
||||||
|
../../configs/sound.nix
|
||||||
../../configs/monitoring.nix
|
../../configs/monitoring.nix
|
||||||
../../configs/retiolum.nix
|
../../configs/retiolum.nix
|
||||||
../../configs/printing.nix
|
../../configs/printing.nix
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
users.extraUsers.kiosk = {
|
users.extraUsers.kiosk = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
password = "";
|
password = "";
|
||||||
extraGroups = ["audio"];
|
extraGroups = ["audio" "pipewire"];
|
||||||
};
|
};
|
||||||
# TODO https://github.com/cage-kiosk/cage/issues/138
|
# TODO https://github.com/cage-kiosk/cage/issues/138
|
||||||
services.cage = {
|
services.cage = {
|
||||||
|
|||||||
@@ -36,6 +36,8 @@ in {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
users.users.${config.services.mpd.user}.extraGroups = ["pipewire"];
|
||||||
|
|
||||||
services.mpd = {
|
services.mpd = {
|
||||||
enable = true;
|
enable = true;
|
||||||
network.listenAddress = "0.0.0.0";
|
network.listenAddress = "0.0.0.0";
|
||||||
@@ -44,7 +46,7 @@ in {
|
|||||||
auto_update "yes"
|
auto_update "yes"
|
||||||
|
|
||||||
audio_output {
|
audio_output {
|
||||||
type "pulse"
|
type "pipewire"
|
||||||
name "zaatar single room audio system"
|
name "zaatar single room audio system"
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
|
|||||||
@@ -1,17 +0,0 @@
|
|||||||
{pkgs, ...}: {
|
|
||||||
sound.enable = true;
|
|
||||||
|
|
||||||
environment.systemPackages = [pkgs.ncpamixer];
|
|
||||||
|
|
||||||
hardware.pulseaudio = {
|
|
||||||
package = pkgs.pulseaudioFull;
|
|
||||||
enable = true;
|
|
||||||
systemWide = true;
|
|
||||||
tcp = {
|
|
||||||
enable = true;
|
|
||||||
anonymousClients.allowedIpRanges = ["127.0.0.1" "10.243.2.0/24" "192.168.0.0/16"];
|
|
||||||
};
|
|
||||||
zeroconf.publish.enable = true;
|
|
||||||
};
|
|
||||||
networking.firewall.allowedTCPPorts = [4713];
|
|
||||||
}
|
|
||||||
@@ -3,7 +3,10 @@
|
|||||||
# mpris is a dbus service for controlling all music players with e.g. playerctl
|
# mpris is a dbus service for controlling all music players with e.g. playerctl
|
||||||
# I do not need this, because I only interact with the service via Spotify Connect
|
# I do not need this, because I only interact with the service via Spotify Connect
|
||||||
# otherẃise it will pull in DBus which fails without X11
|
# otherẃise it will pull in DBus which fails without X11
|
||||||
spotifyd = pkgs.spotifyd.overrideAttrs {withMPris = false;};
|
spotifyd = pkgs.spotifyd.overrideAttrs {
|
||||||
|
withMpris = false;
|
||||||
|
withKeyring = false;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
services.spotifyd = {
|
services.spotifyd = {
|
||||||
@@ -12,7 +15,6 @@
|
|||||||
global = {
|
global = {
|
||||||
username_cmd = "cat $CREDENTIALS_DIRECTORY/username";
|
username_cmd = "cat $CREDENTIALS_DIRECTORY/username";
|
||||||
password_cmd = "cat $CREDENTIALS_DIRECTORY/password";
|
password_cmd = "cat $CREDENTIALS_DIRECTORY/password";
|
||||||
backend = "pulseaudio";
|
|
||||||
bitrate = 320;
|
bitrate = 320;
|
||||||
device_type = "s_t_b"; # set-top box
|
device_type = "s_t_b"; # set-top box
|
||||||
device_name = config.networking.hostName;
|
device_name = config.networking.hostName;
|
||||||
@@ -27,6 +29,8 @@
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
networking.firewall.allowedTCPPorts = [4713];
|
||||||
|
|
||||||
age.secrets = {
|
age.secrets = {
|
||||||
spotify-username.file = ../../secrets/spotify-username.age;
|
spotify-username.file = ../../secrets/spotify-username.age;
|
||||||
spotify-password.file = ../../secrets/spotify-password.age;
|
spotify-password.file = ../../secrets/spotify-password.age;
|
||||||
|
|||||||
Reference in New Issue
Block a user