about summary refs log tree commit diff
path: root/modules/nixos/beets.nix
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--modules/nixos/beets.nix30
1 files changed, 28 insertions, 2 deletions
diff --git a/modules/nixos/beets.nix b/modules/nixos/beets.nix
index 83cbff1..7a380cc 100644
--- a/modules/nixos/beets.nix
+++ b/modules/nixos/beets.nix
@@ -13,7 +13,15 @@ in {
     hm = let
       beetsdir = "${config.dirs.data}/beets";
     in {
-      home.sessionVariables.BEETSDIR = beetsdir;
+      home = {
+        activation.initialiseBeets = ''
+          if [[ ! -d "${beetsdir}" ]]; then
+            mkdir -p ${beetsdir}
+          fi
+        '';
+
+        sessionVariables.BEETSDIR = beetsdir;
+      };
 
       programs = {
         beets = {
@@ -22,7 +30,16 @@ in {
           settings = {
             library = "${beetsdir}/library.db";
             directory = config.userDirs.music;
-            plugins = "badfiles edit fetchart info mbsync scrub";
+            plugins = concatStringsSep " " [
+              "badfiles"
+              "edit"
+              "fetchart"
+              "info"
+              "mbsync"
+              "mpdupdate"
+              "scrub"
+              "zero"
+            ];
             original_date = true;
             import = {
               write = true;
@@ -61,8 +78,17 @@ in {
               cautious = true;
               cover_names = "cover Cover folder Folder art Art album Album front Front";
               sources = "filesystem coverart itunes amazon albumart wikipedia";
+              high_resolution = true;
             };
             scrub.auto = true;
+            zero = {
+              fields = "comments genre";
+              update_database = true;
+            };
+            mpd = {
+              host = "127.0.0.1";
+              port = 6600;
+            };
           };
         };
 

Consider giving Nix/NixOS a try! <3