nixos-config/users/simon/modules/mpd.nix

75 lines
1.9 KiB
Nix

{ config, lib, nixosConfig, pkgs, ... }:
# I only use mpd on gui systems. If I should ever need it on a headless system,
# I will add a separate option.
lib.mkIf nixosConfig.sbruder.gui.enable {
services.mpd = {
enable = true;
musicDirectory = "~/Music";
network.listenAddress = "${config.services.mpd.dataDir}/socket";
package = pkgs.unstable.mpd;
extraConfig = ''
zeroconf_enabled "no"
restore_paused "yes"
replaygain "track"
audio_output {
type "pulse"
name "pulse"
}
audio_output {
type "fifo"
name "fifo"
path "${config.services.mpd.dataDir}/fifo"
format "44100:16:2"
}
'';
};
programs.ncmpcpp = {
enable = true;
package = pkgs.ncmpcpp.override { visualizerSupport = true; taglibSupport = false; };
mpdMusicDir = null; # does not work (not of type `null or path')
settings = {
# Connection
mpd_host = config.services.mpd.network.listenAddress;
# Visualizer
visualizer_fifo_path = "${config.services.mpd.dataDir}/fifo";
visualizer_in_stereo = "yes";
visualizer_look = "+|";
visualizer_output_name = "fifo";
visualizer_sync_interval = "15";
visualizer_type = "spectrum";
# Song list formatting
song_columns_list_format = lib.concatStringsSep " " [
"(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";
};
};
home.packages = with pkgs; [
mpc_cli
];
home.sessionVariables.MPD_HOST = config.services.mpd.network.listenAddress;
}