diff --git a/nixos/modules/services/audio/mpd.nix b/nixos/modules/services/audio/mpd.nix index 3add6556d0df..5bfe2b6a22ad 100644 --- a/nixos/modules/services/audio/mpd.nix +++ b/nixos/modules/services/audio/mpd.nix @@ -55,11 +55,11 @@ in { }; musicDirectory = mkOption { - type = types.path; + type = with types; either path (strMatching "(http|https|nfs|smb)://.+"); default = "${cfg.dataDir}/music"; defaultText = ''''${dataDir}/music''; description = '' - The directory where mpd reads music from. + The directory or NFS/SMB network share where mpd reads music from. ''; }; diff --git a/pkgs/servers/mpd/default.nix b/pkgs/servers/mpd/default.nix index f8523e8607d3..6ca338471119 100644 --- a/pkgs/servers/mpd/default.nix +++ b/pkgs/servers/mpd/default.nix @@ -26,6 +26,8 @@ , clientSupport ? true, mpd_clientlib , opusSupport ? true, libopus , soundcloudSupport ? true, yajl +, nfsSupport ? true, libnfs +, smbSupport ? true, smbclient }: assert avahiSupport -> avahi != null && dbus != null; @@ -81,7 +83,9 @@ in stdenv.mkDerivation rec { ++ opt icuSupport icu ++ opt clientSupport mpd_clientlib ++ opt opusSupport libopus - ++ opt soundcloudSupport yajl; + ++ opt soundcloudSupport yajl + ++ opt (!stdenv.isDarwin && nfsSupport) libnfs + ++ opt (!stdenv.isDarwin && smbSupport) smbclient; nativeBuildInputs = [ autoreconfHook pkgconfig ]; @@ -116,6 +120,8 @@ in stdenv.mkDerivation rec { (mkFlag clientSupport "libmpdclient") (mkFlag opusSupport "opus") (mkFlag soundcloudSupport "soundcloud") + (mkFlag (!stdenv.isDarwin && nfsSupport) "libnfs") + (mkFlag (!stdenv.isDarwin && smbSupport) "smbclient") "--enable-debug" "--with-zeroconf=avahi" ]