From 02e64a8f805ef8a0e261608c70cd820ed06ec7e5 Mon Sep 17 00:00:00 2001 From: k-ot Date: Fri, 28 Feb 2020 20:24:38 +0000 Subject: [PATCH] Remove lib/mpd.nix, configure pulsebert directly --- hosts/pulsebert/configuration.nix | 35 ++++++++++++++++++------------- lib/mpd.nix | 25 ---------------------- 2 files changed, 21 insertions(+), 39 deletions(-) delete mode 100644 lib/mpd.nix diff --git a/hosts/pulsebert/configuration.nix b/hosts/pulsebert/configuration.nix index 30fe76b6..94af3027 100644 --- a/hosts/pulsebert/configuration.nix +++ b/hosts/pulsebert/configuration.nix @@ -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; diff --git a/lib/mpd.nix b/lib/mpd.nix deleted file mode 100644 index 6f825596..00000000 --- a/lib/mpd.nix +++ /dev/null @@ -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 ]; -}