2022-03-08 01:42:46 +00:00
|
|
|
{
|
|
|
|
pkgs,
|
|
|
|
config,
|
|
|
|
...
|
|
|
|
}: {
|
2021-07-05 19:18:23 +00:00
|
|
|
xdg.configFile."beets/config.yaml".text = builtins.toJSON {
|
2020-07-03 13:07:03 +00:00
|
|
|
directory = config.services.mpd.musicDirectory;
|
|
|
|
import.move = true;
|
|
|
|
paths = {
|
|
|
|
default = "$genre/%the{$albumartist}/$album%aunique{}/$track. $title";
|
|
|
|
singleton = "$genre/%the{$artist}/singles/$title";
|
|
|
|
comp = "$genre/%the{$artist}/$album%aunique{}/$track. $title";
|
|
|
|
"genre:soundtrack" = "Soundtrack/$album%aunique{}/$track. $title";
|
2022-03-08 01:42:46 +00:00
|
|
|
"genre::classical" = "$genre/%the{$composer}/$album%aunique{}/$track. $title";
|
2020-07-03 13:07:03 +00:00
|
|
|
};
|
2022-03-08 01:42:46 +00:00
|
|
|
plugins = "convert web mpdstats mpdupdate fromfilename the duplicates missing";
|
2020-07-03 13:07:03 +00:00
|
|
|
convert = {
|
|
|
|
auto = true;
|
2022-03-08 01:42:46 +00:00
|
|
|
command = "${pkgs.ffmpeg}/bin/ffmpeg -i $source -y -vn -acodec libopus -ab 192k $dest";
|
2020-07-03 13:07:03 +00:00
|
|
|
extension = "opus";
|
|
|
|
never_convert_lossy_files = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
systemd.user.services.beets-mpdstats = {
|
|
|
|
Unit.Description = "beets.io mpdstats recorder";
|
2022-03-08 01:42:46 +00:00
|
|
|
Install.WantedBy = ["default.target"];
|
2020-07-03 13:07:03 +00:00
|
|
|
Service = {
|
|
|
|
ExecStart = "${pkgs.beets}/bin/beet mpdstats";
|
|
|
|
Restart = "always";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|