From 236b8fbfeb4547924e405eade08125cb05c2deac Mon Sep 17 00:00:00 2001 From: sajenim Date: Tue, 13 Feb 2024 23:03:10 +0800 Subject: [PATCH] setup mpd server --- nixos/viridian/configuration.nix | 2 ++ nixos/viridian/services/default.nix | 1 + nixos/viridian/services/mpd.nix | 29 +++++++++++++++++++++++++++++ 3 files changed, 32 insertions(+) create mode 100644 nixos/viridian/services/mpd.nix diff --git a/nixos/viridian/configuration.nix b/nixos/viridian/configuration.nix index ddac77c..9cdef40 100644 --- a/nixos/viridian/configuration.nix +++ b/nixos/viridian/configuration.nix @@ -36,6 +36,7 @@ 80 # traefik (HTTP) 443 # traefik (HTTPS) 32372 # qbittorrent + 6600 # mpd ]; allowedUDPPorts = [ 53 # adguardhome (DNS) @@ -43,6 +44,7 @@ 443 # traefik (HTTPS) 32372 # qbittorrent 51820 # Wireguard + 6600 # mpd ]; }; }; diff --git a/nixos/viridian/services/default.nix b/nixos/viridian/services/default.nix index e8f647d..ecf5be3 100644 --- a/nixos/viridian/services/default.nix +++ b/nixos/viridian/services/default.nix @@ -4,5 +4,6 @@ imports = [ ./traefik ./borgbackup.nix + ./mpd.nix ]; } diff --git a/nixos/viridian/services/mpd.nix b/nixos/viridian/services/mpd.nix new file mode 100644 index 0000000..55ebd23 --- /dev/null +++ b/nixos/viridian/services/mpd.nix @@ -0,0 +1,29 @@ +{ ... }: + +{ + services.mpd = { + enable = true; + musicDirectory = "/srv/multimedia/library/music"; + network = { + listenAddress = "any"; + port = 6600; + }; + extraConfig = '' + audio_output { + type "null" + name "This server does not need to play music." + } + ''; + }; + + services.nfs.server = { + enable = true; + lockdPort = 4001; + mountdPort = 4002; + statdPort = 4000; + extraNfsdConfig = ''''; + exports = '' + /srv/multimedia/library/music 192.168.1.101(rw,nohide,insecure,no_subtree_check) + ''; + }; +}