Remove lib/mpd.nix, configure pulsebert directly

This commit is contained in:
k-ot 2020-02-28 20:24:38 +00:00
parent 1f5a5272c4
commit 02e64a8f80
2 changed files with 21 additions and 39 deletions

View File

@ -13,7 +13,6 @@ in {
../../lib
../../lib/admins.nix
../../lib/hq.nix
../../lib/mpd.nix
../../lib/yggdrasil.nix
./mpdConsole.nix
];
@ -92,16 +91,16 @@ in {
networking.firewall.allowedTCPPorts = [
4713 # PulseAudio
631 # cups
80 443 # Web/ympd
80
443 # Web/ympd
5000 # shairport
config.services.mpd.network.port
];
networking.firewall.allowedUDPPorts = [
631
];
networking.firewall.allowedUDPPorts = [ 631 ];
networking.firewall.extraCommands = ''
iptables -I INPUT -p udp --dport mdns -d 224.0.0.251 -j ACCEPT # zeroconf
iptables -I OUTPUT -p udp --dport mdns -d 224.0.0.251 -j ACCEPT # zeroconf
''; # networking.firewall.allowedUDPPorts = [ ... ];
iptables -I INPUT -p udp --dport mdns -d 224.0.0.251 -j ACCEPT # zeroconf
iptables -I OUTPUT -p udp --dport mdns -d 224.0.0.251 -j ACCEPT # zeroconf
''; # networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
@ -200,12 +199,20 @@ in {
# vater hoerte, dass menschen im space gern mpd fuer das abspielen von musik erwarten wuerden
#### https://nixos.org/nixos/options.html#services.mpd.enable
# See ../../mpd.nix
services.mpd.extraConfig = ''
audio_output {
type "pulse"
name "/proc"
}
'';
services.mpd = {
enable = true;
dbFile = null;
musicDirectory = "/mnt/storage/Music";
playlistDirectory = "/home/k-ot/Playlists";
network.listenAddress = "any";
extraConfig = ''
audio_output {
type "pulse"
name "/proc"
}
'';
};
services.caddy = {
enable = true;

View File

@ -1,25 +0,0 @@
{ config, pkgs, lib, ... }:
let
hostMpd = if config.networking.hostName == "storage-ng" then {
musicDirectory = "/mnt/cephfs/c3d2/rpool/Music";
extraConfig = ''
audio_output {
name "null"
type "null"
}
'';
} else {
dbFile = null;
musicDirectory = "/mnt/storage/Music";
playlistDirectory = "/home/k-ot/Playlists";
};
in {
c3d2.hq.enableMpdProxy = true;
services.mpd = (hostMpd // {
enable = true;
network.listenAddress = "any";
});
networking.firewall.allowedTCPPorts = [ config.services.mpd.network.port ];
}