2021-02-12 21:12:03 +01:00
|
|
|
{ config, lib, nixosConfig, pkgs, ... }:
|
2020-11-07 15:27:13 +01:00
|
|
|
|
2021-01-30 13:27:29 +01:00
|
|
|
# I only use mpd on gui systems. If I should ever need it on a headless system,
|
|
|
|
# I will add a separate option.
|
2021-02-12 21:12:03 +01:00
|
|
|
lib.mkIf nixosConfig.sbruder.gui.enable {
|
2020-11-07 15:27:13 +01:00
|
|
|
services.mpd = {
|
|
|
|
enable = true;
|
2021-12-01 18:24:04 +01:00
|
|
|
package = pkgs.mpd;
|
2022-08-17 22:48:21 +02:00
|
|
|
musicDirectory = "${config.home.homeDirectory}/Music";
|
|
|
|
playlistDirectory = "${config.services.mpd.musicDirectory}/playlists";
|
2020-12-05 18:53:35 +01:00
|
|
|
network.listenAddress = "${config.services.mpd.dataDir}/socket";
|
2020-11-07 15:27:13 +01:00
|
|
|
extraConfig = ''
|
|
|
|
zeroconf_enabled "no"
|
|
|
|
|
|
|
|
restore_paused "yes"
|
|
|
|
|
|
|
|
audio_output {
|
2021-11-20 16:44:54 +01:00
|
|
|
type "pipewire"
|
|
|
|
name "pipewire"
|
2020-11-07 15:27:13 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
audio_output {
|
|
|
|
type "fifo"
|
|
|
|
name "fifo"
|
|
|
|
path "${config.services.mpd.dataDir}/fifo"
|
|
|
|
format "44100:16:2"
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
programs.ncmpcpp = {
|
|
|
|
enable = true;
|
2021-07-25 13:44:50 +02:00
|
|
|
package = (pkgs.ncmpcpp.override {
|
|
|
|
visualizerSupport = true;
|
|
|
|
taglibSupport = false;
|
|
|
|
});
|
2020-11-07 15:27:13 +01:00
|
|
|
mpdMusicDir = null; # does not work (not of type `null or path')
|
|
|
|
settings = {
|
2020-12-05 18:53:35 +01:00
|
|
|
# Connection
|
2021-02-27 17:50:14 +01:00
|
|
|
mpd_host = config.services.mpd.network.listenAddress;
|
2020-12-05 18:53:35 +01:00
|
|
|
|
2020-11-07 15:27:13 +01:00
|
|
|
# Visualizer
|
2021-05-29 18:04:29 +02:00
|
|
|
visualizer_autoscale = true;
|
|
|
|
visualizer_data_source = "${config.services.mpd.dataDir}/fifo";
|
2020-11-07 15:27:13 +01:00
|
|
|
visualizer_in_stereo = "yes";
|
2021-05-29 18:04:29 +02:00
|
|
|
visualizer_look = "●█";
|
2020-11-07 15:27:13 +01:00
|
|
|
visualizer_output_name = "fifo";
|
2021-05-29 18:04:29 +02:00
|
|
|
visualizer_spectrum_dft_size = 1;
|
2020-11-07 15:27:13 +01:00
|
|
|
|
|
|
|
# Song list formatting
|
2021-02-27 19:55:12 +01:00
|
|
|
song_columns_list_format = lib.concatStringsSep " " [
|
2020-11-07 15:27:13 +01:00
|
|
|
"(6f)[green]{NE}"
|
|
|
|
"(45)[white]{t|f:Title}"
|
|
|
|
"(20)[]{a}"
|
|
|
|
"(25)[cyan]{b}"
|
|
|
|
"(5f)[blue]{P}"
|
|
|
|
"(7f)[magenta]{l}"
|
|
|
|
];
|
|
|
|
|
|
|
|
# Display lists in column mode by default
|
|
|
|
browser_display_mode = "columns";
|
|
|
|
search_engine_display_mode = "columns";
|
|
|
|
|
|
|
|
# Faster seeking
|
|
|
|
seek_time = 5;
|
|
|
|
|
|
|
|
# More modern UI
|
|
|
|
user_interface = "alternative";
|
2021-07-02 18:02:41 +02:00
|
|
|
|
2023-01-28 22:10:04 +01:00
|
|
|
# Lyrics
|
|
|
|
lyrics_directory = "${config.services.mpd.musicDirectory}/lyrics";
|
|
|
|
|
2021-07-02 18:02:41 +02:00
|
|
|
# Misc
|
|
|
|
external_editor = "nvim";
|
2020-11-07 15:27:13 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
home.packages = with pkgs; [
|
|
|
|
mpc_cli
|
|
|
|
];
|
2021-02-27 18:33:32 +01:00
|
|
|
|
|
|
|
home.sessionVariables.MPD_HOST = config.services.mpd.network.listenAddress;
|
2020-11-07 15:27:13 +01:00
|
|
|
}
|