From fbcc4daff7652ad630e7bb0d6ae71467aa2609e3 Mon Sep 17 00:00:00 2001 From: Johannes Frankenau Date: Sat, 21 Jul 2018 22:32:20 +0200 Subject: [PATCH 1/2] mpd: add nfs and smb support --- pkgs/servers/mpd/default.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkgs/servers/mpd/default.nix b/pkgs/servers/mpd/default.nix index 35637e7f73ac..d22beac6e9da 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 nfsSupport libnfs + ++ opt smbSupport smbclient; nativeBuildInputs = [ autoreconfHook pkgconfig ]; @@ -116,6 +120,8 @@ in stdenv.mkDerivation rec { (mkFlag clientSupport "libmpdclient") (mkFlag opusSupport "opus") (mkFlag soundcloudSupport "soundcloud") + (mkFlag nfsSupport "libnfs") + (mkFlag smbSupport "smbclient") "--enable-debug" "--with-zeroconf=avahi" ] From b9234ea49c6bfb71d1435fd584ae83123f61fa67 Mon Sep 17 00:00:00 2001 From: Johannes Frankenau Date: Sat, 21 Jul 2018 23:19:34 +0200 Subject: [PATCH 2/2] nixos/mpd: allow storage plugins in musicDirectory --- nixos/modules/services/audio/mpd.nix | 4 ++-- pkgs/servers/mpd/default.nix | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) 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 d22beac6e9da..b88b13cdf16f 100644 --- a/pkgs/servers/mpd/default.nix +++ b/pkgs/servers/mpd/default.nix @@ -84,8 +84,8 @@ in stdenv.mkDerivation rec { ++ opt clientSupport mpd_clientlib ++ opt opusSupport libopus ++ opt soundcloudSupport yajl - ++ opt nfsSupport libnfs - ++ opt smbSupport smbclient; + ++ opt (!stdenv.isDarwin && nfsSupport) libnfs + ++ opt (!stdenv.isDarwin && smbSupport) smbclient; nativeBuildInputs = [ autoreconfHook pkgconfig ]; @@ -120,8 +120,8 @@ in stdenv.mkDerivation rec { (mkFlag clientSupport "libmpdclient") (mkFlag opusSupport "opus") (mkFlag soundcloudSupport "soundcloud") - (mkFlag nfsSupport "libnfs") - (mkFlag smbSupport "smbclient") + (mkFlag (!stdenv.isDarwin && nfsSupport) "libnfs") + (mkFlag (!stdenv.isDarwin && smbSupport) "smbclient") "--enable-debug" "--with-zeroconf=avahi" ]