From 1ea1b781a142a41b72aed4bfc408233732034241 Mon Sep 17 00:00:00 2001 From: Azat Bahawi Date: Mon, 20 Mar 2023 03:24:54 +0300 Subject: 2023-03-20 --- modules/nixos/beets.nix | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) (limited to 'modules/nixos/beets.nix') 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; + }; }; }; -- cgit 1.4.1