2020-07-03 02:53:43 +00:00
|
|
|
{ pkgs, config, ... }:
|
|
|
|
let musicDirectory = "${config.home.homeDirectory}/media/audio";
|
|
|
|
in {
|
2020-07-02 19:36:42 +00:00
|
|
|
home.file.".config/beets/config.yaml".text = builtins.toJSON {
|
2020-07-03 02:53:43 +00:00
|
|
|
directory = musicDirectory;
|
2020-07-02 19:36:42 +00:00
|
|
|
library = "~/.config/beets/musiclibrary.db";
|
|
|
|
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";
|
2020-07-03 02:53:43 +00:00
|
|
|
"genre::classical" =
|
|
|
|
"$genre/%the{$composer}/$album%aunique{}/$track $title";
|
2020-07-02 19:36:42 +00:00
|
|
|
};
|
2020-07-03 02:53:43 +00:00
|
|
|
plugins =
|
|
|
|
"convert web mpdstats mpdupdate fromfilename the duplicates missing";
|
2020-07-02 19:36:42 +00:00
|
|
|
convert = {
|
|
|
|
auto = true;
|
2020-07-03 02:53:43 +00:00
|
|
|
command =
|
|
|
|
"${pkgs.ffmpeg}/bin/ffmpeg -i $source -y -vn -acodec libopus -ab 128k $dest";
|
|
|
|
extension = "opus";
|
2020-07-02 19:36:42 +00:00
|
|
|
never_convert_lossy_files = true;
|
|
|
|
};
|
|
|
|
};
|
2020-05-05 23:40:57 +00:00
|
|
|
services = {
|
|
|
|
mpd = {
|
|
|
|
enable = true;
|
2020-07-03 02:53:43 +00:00
|
|
|
inherit musicDirectory;
|
2020-05-05 23:40:57 +00:00
|
|
|
extraConfig = ''
|
|
|
|
audio_output {
|
|
|
|
type "pulse"
|
|
|
|
name "Pulseaudio"
|
|
|
|
server "localhost"
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
};
|
2020-07-03 02:53:43 +00:00
|
|
|
mpdris2.enable = true;
|
2020-05-05 23:40:57 +00:00
|
|
|
};
|
|
|
|
}
|