# nixos-config - My current NixOS configuration # # Copyright (C) 2025 Benedikt Peetz # SPDX-License-Identifier: GPL-3.0-or-later # # This file is part of my nixos-config. # # You should have received a copy of the License along with this program. # If not, see . { pkgs, lib, config, ... }: let plugins = import ./plugins.nix {}; # TODO: Enable xtractor again <2025-03-29> # package = pkgs.beets.override { # pluginOverrides = { # xtractor = { # enable = true; # propagatedBuildInputs = [pkgs.beetsExtraPlugins.xtractor]; # }; # }; package = pkgs.beets; in { imports = [ ./plugins ]; programs.beets = { enable = true; inherit package; settings = { library = "${config.xdg.dataHome}/beets/library.db"; art_filename = "cover"; directory = "${config.xdg.userDirs.music}/beets"; ui = { color = true; }; replace = { "[/]" = "\\"; "[\\x00-\\x1f]" = ""; "\\s+$" = ""; "^\\s+" = ""; }; import = { # move, instead of copying or linking the files copy = false; move = true; link = false; # Show more detail, when beet needs to ask for something detail = true; incremental = false; # Write the metadata to the files write = true; log = "${config.xdg.dataHome}/beets/beetslog.txt"; }; paths = let join = lib.strings.concatStringsSep "/"; in { "albumtype:live" = join ["[Live, please delete]" "$genre" "$first_artist" "$album ($albumtype)" "$track $title"]; default = "$albumartist/$album%aunique{}/$track $title"; }; inherit plugins; # Plugin config # scrub = { # auto = true; # }; musicbrainz = { # Search for deezer id's and use them in the autotagger # external_ids = { # deezer = true; # }; }; # Log-on config # TODO: Add this, to upload the generated fingerprints (to help improve their # database) <2024-08-07> # acoustid = { # apikey = "TODO"; # }; }; mpdIntegration = { enableStats = true; enableUpdate = true; host = config.home.sessionVariables.MPD_HOST; }; }; # Use the json formatter instead of the YAML one, as the YAML formatter mangles the # longer python inline strings. # YAML is a superset of JSON. xdg.configFile."beets/config.yaml".source = lib.mkForce ((pkgs.formats.json {}).generate "beets-config" config.programs.beets.settings); }