my system configurations ^-^
1{
2 lib,
3 osConfig,
4 config,
5 pkgs,
6 ...
7}: let
8 cfg = osConfig.settings.programs;
9 inherit (pkgs) stdenv;
10in {
11 config = lib.mkIf (cfg.cli.enable
12 && cfg.categories.music.enable) {
13 systemd.user.services.mpdstats =
14 lib.mkIf stdenv.isLinux
15 && config.services.mpd.enable
16 == true {
17 Unit = {
18 Description = "Beets MPDStats daemon";
19 Requires = ["mpd.service"];
20 After = ["mpd.service"];
21 };
22
23 Install.WantedBy = ["default.target"];
24
25 Service = {
26 ExecStart = "${config.programs.beets.package}/bin/beet mpdstats";
27 Restart = "on-failure";
28 };
29 };
30 programs.beets = {
31 enable = true;
32 mpdIntegration.enableUpdate = true;
33 settings = {
34 plugins = [
35 "fetchart"
36 "thumbnails"
37 "mbsync"
38 "edit"
39 ];
40 directory = "${config.xdg.userDirs.music}/music";
41 library = "${config.xdg.userDirs.music}/music_library.db";
42 import = {
43 copy = true;
44 write = true;
45 autotag = true;
46 };
47 paths = {
48 default = "Albums/%upper{%left{$albumartist,1}}/$albumartist/$album%aunique{}/$track. $title";
49 singleton = "Singles/$artist/$title";
50 comp = "Compilations/$album%aunique{}/$track. $title";
51 };
52 fetchart = {
53 auto = true;
54 sources = [
55 "filesystem"
56 "amazon"
57 "itunes"
58 "coverart"
59 "albumart"
60 ];
61 };
62 };
63 };
64 };
65}