From bb196fb98eff82ddf81c0d8f7c2beba508bd524e Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sat, 21 Apr 2018 20:56:21 +0200 Subject: =?UTF-8?q?=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bragi.nix | 2 +- custom/mpd.nix | 30 +++++++++++++++++++++++++++--- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/bragi.nix b/bragi.nix index 03a42064..cbc04bf0 100644 --- a/bragi.nix +++ b/bragi.nix @@ -229,7 +229,7 @@ in rec { services.mpd = { enable = true; musicDirectory = "smb://odin.asgard.yggdrasil/media/music"; - listenAddresses = [ + network.listenAddresses = [ { address = "any"; } "/var/lib/mpd/socket" ]; diff --git a/custom/mpd.nix b/custom/mpd.nix index 8df2a955..fceb62fe 100644 --- a/custom/mpd.nix +++ b/custom/mpd.nix @@ -122,9 +122,33 @@ in { description = "Group account under which MPD runs."; }; - listenAddresses = mkOption { - type = with types; listOf (either (submodule tcpAddress) str); - default = [{ address = "127.0.0.1"; }]; + network = { + + listenAddress = mkOption { + type = types.str; + default = "127.0.0.1"; + example = "any"; + description = '' + The address for the daemon to listen on. + Use any to listen on all addresses. + ''; + }; + + port = mkOption { + type = types.int; + default = 6600; + description = '' + This setting is the TCP port that is desired for the daemon to get assigned + to. + ''; + }; + + + listenAddresses = mkOption { + type = with types; listOf (either (submodule tcpAddress) str); + default = [{ address = cfg.network.listenAddress; port = cfg.network.port; }]; + }; + }; dbFile = mkOption { -- cgit v1.2.3