diff --git a/home/common/optional/desktop/dwm/default.nix b/home/common/optional/desktop/dwm/default.nix index 34ca005..7837199 100644 --- a/home/common/optional/desktop/dwm/default.nix +++ b/home/common/optional/desktop/dwm/default.nix @@ -9,6 +9,7 @@ ./picom.nix ./xresources.nix ./dunst.nix + ./music_player.nix # Status bar scripts ./scripts/sb-cpu-pct.nix diff --git a/home/common/optional/desktop/dwm/music_player.nix b/home/common/optional/desktop/dwm/music_player.nix new file mode 100644 index 0000000..cbeaa79 --- /dev/null +++ b/home/common/optional/desktop/dwm/music_player.nix @@ -0,0 +1,65 @@ +{ pkgs, config, ... }: +{ + home.file."mus/music_data".source = config.lib.file.mkOutOfStoreSymlink /media/music/music_data; + + home.packages = [ + pkgs.ffmpeg + pkgs.nsxiv + pkgs.kunst + pkgs.mpc-cli + pkgs.jq + pkgs.imagemagick + ]; + + services.mpd = { + enable = true; + package = pkgs.mpd; + extraConfig = '' + + music_directory "~/mus/music_data" + playlist_directory "~/.local/share/mpd/playlists" + + log_file "~/.local/share/mpd/log" + db_file "~/.local/share/mpd/database" + pid_file "~/.local/share/mpd/pid" + state_file "~/.local/share/mpd/state" + sticker_file "~/.local/share/mpd/sticker.sql" + + auto_update "yes" + + audio_output { + type "pipewire" + name "PipeWire Sound Server" + } + + audio_output { + type "fifo" + name "Visualizer feed" + path "/tmp/mpd.fifo" + format "44100:16:2" + } + + bind_to_address "127.0.0.1" ''; + musicDirectory = "~/mus/music_data"; + }; + + programs.ncmpcpp = { + enable = true; + package = (pkgs.ncmpcpp.override { visualizerSupport = true; }); + mpdMusicDir = "~/mus/music_data"; + settings = { + mpd_host = "127.0.0.1"; + mpd_port = "6600"; + visualizer_data_source = "/tmp/mpd.fifo"; + visualizer_output_name = "Visualizer Feed"; + visualizer_in_stereo = "yes"; + visualizer_type = "spectrum"; + visualizer_fps = "60"; + visualizer_autoscale = "no"; + visualizer_look = "●▮"; + visualizer_color = "169, 170, 169, 135, 134, 133, 129, 128, 127, 126, 125, 124"; + visualizer_spectrum_smooth_look = "yes"; + visualizer_spectrum_dft_size = "3"; + }; + }; +}