about summary refs log tree commit diff
path: root/modules/nixos/beets.nix
diff options
context:
space:
mode:
authorAzat Bahawi <azat@bahawi.net>2023-03-20 03:24:54 +0300
committerAzat Bahawi <azat@bahawi.net>2023-03-20 03:24:54 +0300
commit1ea1b781a142a41b72aed4bfc408233732034241 (patch)
treeff1124f7c52fdfcaa864e6866c22a7acf68f7c55 /modules/nixos/beets.nix
parent2023-03-16 (diff)
2023-03-20
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