about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2020-11-10 13:30:06 +0100
committerPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2020-11-10 13:30:06 +0100
commit2ac213c65cf4a06cfcfb6fc7c6e56da2ca098a6c (patch)
tree08fff53cd79fdfaeff6dd6d889deee296c42d41e
parentbd6879e33f060323c8a2f9ecf5f425bda0042314 (diff)
downloadpnpkgs-2ac213c65cf4a06cfcfb6fc7c6e56da2ca098a6c.tar.gz
pnpkgs-2ac213c65cf4a06cfcfb6fc7c6e56da2ca098a6c.zip
Add custom music directory
-rw-r--r--pkgs/larbs-music/default.nix6
1 files changed, 4 insertions, 2 deletions
diff --git a/pkgs/larbs-music/default.nix b/pkgs/larbs-music/default.nix
index 1dde000..aec9e5f 100644
--- a/pkgs/larbs-music/default.nix
+++ b/pkgs/larbs-music/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildEnv, makeWrapper, makeDesktopItem, callPackage, ncmpcpp, libnotify }:
+{ stdenv, buildEnv, makeWrapper, makeDesktopItem, callPackage, ncmpcpp, libnotify, musicDir ? "~/Music" }:
 with stdenv.lib;
 
 let
@@ -18,8 +18,10 @@ let
     buildInputs = [ makeWrapper ];
 
     installPhase = ''
+      mkdir -p $out/share/ncmpcpp
+      sed 's:mpd_music_dir.*:mpd_music_dir = "${musicDir}":' ${config} > $out/share/ncmpcpp/config
       makeWrapper ${vizNcmpcpp}/bin/ncmpcpp $out/bin/ncmpcpp \
-      --add-flags "-c ${config}" \
+      --add-flags "-c $out/share/ncmpcpp/config" \
       --add-flags "-b ${bindings}"
     '';