From 4dcde73af97061483a95b02c1480fc6917973aa6 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Thu, 3 Jul 2025 11:11:53 +0530 Subject: Switch back to mpd --- modules/music/mpd.home.nix | 55 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 modules/music/mpd.home.nix (limited to 'modules/music/mpd.home.nix') diff --git a/modules/music/mpd.home.nix b/modules/music/mpd.home.nix new file mode 100644 index 0000000..3619786 --- /dev/null +++ b/modules/music/mpd.home.nix @@ -0,0 +1,55 @@ +{ ... }@moduleAttrs: +let + cfg = import ./config.nix moduleAttrs; +in +{ + services.mpd = { + enable = true; + musicDirectory = cfg.mpd.musicDir; + playlistDirectory = cfg.mpd.playlistDir; + network = { + listenAddress = cfg.mpd.host; + port = cfg.mpd.port; + }; + extraConfig = '' + user "imsohexy" + group "users" + restore_paused "yes" + metadata_to_use "artist,album,title,track,name,genre,date,composer,performer,disc" + auto_update "yes" + auto_update_depth "5" + follow_outside_symlinks "yes" + follow_inside_symlinks "yes" + + input { + plugin "curl" + } + + audio_output { + type "pipewire" + name "My PipeWire Device" + } + + audio_output { + type "fifo" + name "${cfg.mpd.visualizer_name}" + path "${cfg.mpd.visualizer_fifo}" + format "44100:16:2" + } + + filesystem_charset "UTF-8" + ''; + }; + + services.mpdris2 = { + # TODO: Hook to update dwmblock + enable = true; + notifications = false; + multimediaKeys = false; + mpd = { + host = cfg.mpd.host; + port = cfg.mpd.port; + musicDirectory = cfg.mpd.musicDir; + }; + }; +} -- cgit v1.3.1