aboutsummaryrefslogtreecommitdiffstats
path: root/modules/home/conf/beets
diff options
context:
space:
mode:
Diffstat (limited to 'modules/home/conf/beets')
-rw-r--r--modules/home/conf/beets/default.nix103
-rw-r--r--modules/home/conf/beets/plugins.nix67
-rw-r--r--modules/home/conf/beets/plugins/badfiles/default.nix13
-rw-r--r--modules/home/conf/beets/plugins/default.nix16
-rw-r--r--modules/home/conf/beets/plugins/duplicates/default.nix5
-rw-r--r--modules/home/conf/beets/plugins/fuzzy/default.nix6
-rw-r--r--modules/home/conf/beets/plugins/ihate/default.nix8
-rw-r--r--modules/home/conf/beets/plugins/inline/default.nix42
-rw-r--r--modules/home/conf/beets/plugins/lastgenre/default.nix7
-rw-r--r--modules/home/conf/beets/plugins/lyrics/default.nix6
-rw-r--r--modules/home/conf/beets/plugins/mbsubmit/default.nix9
-rw-r--r--modules/home/conf/beets/plugins/play/default.nix14
-rw-r--r--modules/home/conf/beets/plugins/replaygain/default.nix24
-rw-r--r--modules/home/conf/beets/plugins/smartplaylist/default.nix33
-rw-r--r--modules/home/conf/beets/plugins/xtractor/default.nix95
-rw-r--r--modules/home/conf/beets/replace_override.yaml10
16 files changed, 0 insertions, 458 deletions
diff --git a/modules/home/conf/beets/default.nix b/modules/home/conf/beets/default.nix
deleted file mode 100644
index 8d6277b7..00000000
--- a/modules/home/conf/beets/default.nix
+++ /dev/null
@@ -1,103 +0,0 @@
-{
- pkgs,
- lib,
- config,
- ...
-}: let
- plugins = import ./plugins.nix {};
-in {
- imports = [
- ./plugins
- ];
-
- programs.beets = {
- enable = true;
- package = pkgs.beets.override {
- pluginOverrides = {
- xtractor = {
- enable = true;
- propagatedBuildInputs = [pkgs.beetsExtraPlugins.xtractor];
- };
- };
- };
-
- settings = {
- library = "${config.xdg.dataHome}/beets/library.db";
- art_filename = "cover";
- directory = "${config.xdg.userDirs.music}/beets";
- ui = {
- color = true;
- };
-
- include = [
- "./replace_override.yaml"
- ];
-
- 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
- j = lib.strings.concatStringsSep "/";
- in {
- default = j ["[Default]" "$genre" "$first_artist" "$album ($albumtype)" "$track $title"];
- "albumtype:live" = j ["[Live]" "$genre" "$first_artist" "$album ($albumtype)" "$track $title"];
-
- "albumtype:album" = j ["Music" "$genre" "$first_artist" "$album ($albumtype)" "$track $title"];
- "albumtype::(Single|EP)" = j ["Music" "$genre" "$first_artist_singleton" "$album ($albumtype)" "$track $title"];
- "albumtype:compilation" = j ["Complilations" "$genre" "Various Artists" "$album ($albumtype)" "$track $title"];
- "albumtype:soundtrack" = j ["Soundtracks" "$genre" "$first_artist" "$album" "$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;
- };
- };
-
- xdg.configFile."beets/replace_override.yaml".source = ./replace_override.yaml;
-
- # 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);
-}
diff --git a/modules/home/conf/beets/plugins.nix b/modules/home/conf/beets/plugins.nix
deleted file mode 100644
index bea2fefe..00000000
--- a/modules/home/conf/beets/plugins.nix
+++ /dev/null
@@ -1,67 +0,0 @@
-{...}:
-# NOTE: This list is here and not split over the various plugin dirs, as we need a way to
-# specify the order plugins are loaded in. <2024-08-11>
-[
- # Remove all previous tags before import (this is useful to ensure, that
- # the metadata in the libary.db is synced with the tags on disk)
- # # FIXME: I think, that this also removes the deezer id, which is not ideal
- # <2024-08-07>
- # "scrub"
-
- # Help submitting stuff to music brainz
- "mbsubmit"
-
- # Extract things from the music file
- "xtractor"
-
- # Calculate replay gain
- "replaygain"
-
- # Check for bad files
- "badfiles"
-
- # Alows to use inline python for parsing tags
- "inline"
-
- # Support player integration
- "play"
-
- # Show tags on files/queries
- "info"
-
- # Create playlist from `play_count`/`skip_count` (gathered by the `mpdstats`
- # plugin)
- # Note that this should come _before_ the `mpdupdate` plugin, to ensure that
- # `mpdupgate` can propagate changed playlist to `mpd`.
- "smartplaylist"
-
- # Warn, when importing a matching item
- "ihate"
-
- # Allow fuzzy searching
- "fuzzy"
-
- # Filter out duplicates
- "duplicates"
-
- # Generate fingerprints
- "chroma"
-
- # Download album art
- "fetchart"
-
- # Fetches tags from `last.fm` and adds them as genres to imported music
- "lastgenre"
-
- # Run commands on events
- "hook"
-
- # Fetch lyrics
- "lyrics"
-
- # Allow beets to understand deezer id's
- # "deezer"
-
- "mpdstats" # Transfer MPD stats to beets
- "mpdupdate" # Update MPD database on import
-]
diff --git a/modules/home/conf/beets/plugins/badfiles/default.nix b/modules/home/conf/beets/plugins/badfiles/default.nix
deleted file mode 100644
index 33884785..00000000
--- a/modules/home/conf/beets/plugins/badfiles/default.nix
+++ /dev/null
@@ -1,13 +0,0 @@
-{
- lib,
- pkgs,
- ...
-}: {
- programs.beets.settings.badfiles = {
- check_on_import = true;
- commands = {
- flac = "${lib.getExe' pkgs.flac "flac"} --test --warnings-as-errors --silent";
- mp3 = "${lib.getExe pkgs.mp3val}";
- };
- };
-}
diff --git a/modules/home/conf/beets/plugins/default.nix b/modules/home/conf/beets/plugins/default.nix
deleted file mode 100644
index 3bea5ea8..00000000
--- a/modules/home/conf/beets/plugins/default.nix
+++ /dev/null
@@ -1,16 +0,0 @@
-{...}: {
- imports = [
- ./badfiles
- ./duplicates
- ./fuzzy
- ./ihate
- ./inline
- ./lastgenre
- ./lyrics
- ./mbsubmit
- ./play
- ./replaygain
- ./smartplaylist
- ./xtractor
- ];
-}
diff --git a/modules/home/conf/beets/plugins/duplicates/default.nix b/modules/home/conf/beets/plugins/duplicates/default.nix
deleted file mode 100644
index c8a6c108..00000000
--- a/modules/home/conf/beets/plugins/duplicates/default.nix
+++ /dev/null
@@ -1,5 +0,0 @@
-{...}: {
- programs.beets.settings.duplicates = {
- keys = ["acoustid_fingerprint"];
- };
-}
diff --git a/modules/home/conf/beets/plugins/fuzzy/default.nix b/modules/home/conf/beets/plugins/fuzzy/default.nix
deleted file mode 100644
index b86b3a20..00000000
--- a/modules/home/conf/beets/plugins/fuzzy/default.nix
+++ /dev/null
@@ -1,6 +0,0 @@
-{...}: {
- programs.beets.settings.fuzzy = {
- # The prefix denoting that a search should be run in fuzzy mode
- prefix = ".";
- };
-}
diff --git a/modules/home/conf/beets/plugins/ihate/default.nix b/modules/home/conf/beets/plugins/ihate/default.nix
deleted file mode 100644
index 145f5f8b..00000000
--- a/modules/home/conf/beets/plugins/ihate/default.nix
+++ /dev/null
@@ -1,8 +0,0 @@
-{...}: {
- programs.beets.settings.ihate = {
- warn = [
- "title:commentary"
- "albumtype:live"
- ];
- };
-}
diff --git a/modules/home/conf/beets/plugins/inline/default.nix b/modules/home/conf/beets/plugins/inline/default.nix
deleted file mode 100644
index 0dda8cfc..00000000
--- a/modules/home/conf/beets/plugins/inline/default.nix
+++ /dev/null
@@ -1,42 +0,0 @@
-{...}: {
- programs.beets.settings = {
- item_fields = {
- # Taken from https://github.com/trapd00r/configs/blob/4f3dada5700846cca6c2869e6fa6b3c795b87b67/beets/config.yaml
- first_artist =
- /*
- python
- */
- ''
- # import an album to another artists directory, like:
- # Tom Jones │1999│ Burning Down the House [Single, CD, FLAC]
- # to The Cardigans/+singles/Tom Jones & the Cardigans │1999│ Burning Down the House [Single, CD, FLAC]
- # https://github.com/beetbox/beets/discussions/4012#discussioncomment-1021414
- # beet import --set myartist='The Cardigans'
- # we must first check to see if myartist is defined, that is, given on
- # import time, or we raise an NameError exception.
- try:
- myartist
- except NameError:
- import re
- return re.split(',|\\s+(feat(.?|uring)|&|(Vs|Ft).)', albumartist, 1, flags=re.IGNORECASE)[0]
- else:
- return myartist
- '';
-
- first_artist_singleton =
- /*
- python
- */
- ''
- try:
- myartist
- except NameError:
- import re
- return re.split(',|\\s+(feat(.?|uring)|&|(Vs|Ft).)', artist, 1, flags=re.IGNORECASE)[0]
- else:
- return myartist
- '';
- };
- album_fields = {};
- };
-}
diff --git a/modules/home/conf/beets/plugins/lastgenre/default.nix b/modules/home/conf/beets/plugins/lastgenre/default.nix
deleted file mode 100644
index d10ca49f..00000000
--- a/modules/home/conf/beets/plugins/lastgenre/default.nix
+++ /dev/null
@@ -1,7 +0,0 @@
-{...}: {
- programs.beets.settings.lastgenre = {
- prefer_specific = false;
- # Lookup the track, not the album
- source = "track";
- };
-}
diff --git a/modules/home/conf/beets/plugins/lyrics/default.nix b/modules/home/conf/beets/plugins/lyrics/default.nix
deleted file mode 100644
index 80544aea..00000000
--- a/modules/home/conf/beets/plugins/lyrics/default.nix
+++ /dev/null
@@ -1,6 +0,0 @@
-{...}: {
- programs.beets.settings.lyrics = {
- # Always fetch lyrics (and update them, if some were found)
- force = true;
- };
-}
diff --git a/modules/home/conf/beets/plugins/mbsubmit/default.nix b/modules/home/conf/beets/plugins/mbsubmit/default.nix
deleted file mode 100644
index b70f1c63..00000000
--- a/modules/home/conf/beets/plugins/mbsubmit/default.nix
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- lib,
- pkgs,
- ...
-}: {
- programs.beets.settings.mbsubmit = {
- picard_path = lib.getExe pkgs.picard;
- };
-}
diff --git a/modules/home/conf/beets/plugins/play/default.nix b/modules/home/conf/beets/plugins/play/default.nix
deleted file mode 100644
index f5bc3c9b..00000000
--- a/modules/home/conf/beets/plugins/play/default.nix
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- lib,
- pkgs,
- config,
- ...
-}: {
- programs.beets.settings.play = {
- command = "${lib.getExe pkgs.mpc-cli} $args add";
- relative_to = config.services.mpd.musicDirectory;
-
- # Run the command with the returned paths as arguments
- raw = true;
- };
-}
diff --git a/modules/home/conf/beets/plugins/replaygain/default.nix b/modules/home/conf/beets/plugins/replaygain/default.nix
deleted file mode 100644
index 611f3799..00000000
--- a/modules/home/conf/beets/plugins/replaygain/default.nix
+++ /dev/null
@@ -1,24 +0,0 @@
-{...}: {
- programs.beets.settings = {
- replaygain = {
- auto = true;
- backend = "ffmpeg";
-
- r128_targetlevel = 89;
-
- # Re-calculate the replay gain value even for files, that already have one set.
- overwrite = true;
- };
-
- hook = {
- hooks = [
- {
- # Also generate the replaygain for the album variant (so selecting between
- # track and album becomes possible)
- event = "import";
- command = "echo Remember to run 'beet replaygain --album' to generate the album replaygain values for the imported songs!";
- }
- ];
- };
- };
-}
diff --git a/modules/home/conf/beets/plugins/smartplaylist/default.nix b/modules/home/conf/beets/plugins/smartplaylist/default.nix
deleted file mode 100644
index b55c487c..00000000
--- a/modules/home/conf/beets/plugins/smartplaylist/default.nix
+++ /dev/null
@@ -1,33 +0,0 @@
-{config, ...}: {
- programs.beets.settings.smartplaylist = {
- relative_to = config.services.mpd.musicDirectory;
- playlist_dir = config.services.mpd.playlistDirectory;
- forward_slash = false;
-
- # Show the real m3u file paths, when running `--pretend`
- pretend_paths = true;
-
- playlists = [
- {
- name = "artists-$first_artist.m3u";
- query = "";
- }
- {
- name = "ratings-good.m3u";
- query = "rating:0.7..1.0";
- }
- {
- name = "ratings-mediocre.m3u";
- query = "rating:0.4..0.7";
- }
- {
- name = "ratings-bad.m3u";
- query = "rating:0.0..0.4";
- }
- {
- name = "not_played.m3u";
- query = "-play_count: artist:";
- }
- ];
- };
-}
diff --git a/modules/home/conf/beets/plugins/xtractor/default.nix b/modules/home/conf/beets/plugins/xtractor/default.nix
deleted file mode 100644
index d4582c5f..00000000
--- a/modules/home/conf/beets/plugins/xtractor/default.nix
+++ /dev/null
@@ -1,95 +0,0 @@
-{
- lib,
- pkgs,
- config,
- ...
-}: {
- programs.beets.settings = {
- xtractor = {
- # This option is not yet implemented, thus requiring the hook
- auto = true;
-
- dry-run = false;
- # Writes the bpm key to the media files
- write = true;
- threads = 0;
- # Also run for files, which already have the required keys
- force = true;
- quiet = false;
- keep_output = true;
- keep_profiles = true;
- output_path = "${config.xdg.dataHome}/beets/xtactor";
- essentia_extractor = "${lib.getExe pkgs.essentia-extractor}";
- extractor_profile = {
- highlevel = {
- svm_models = let
- m = pkgs.beetsExtraPlugins.xtractor.models;
- in [
- "${m}/danceability.history"
- "${m}/danceability.history.param"
- "${m}/danceability.history.results.html"
- "${m}/gender.history"
- "${m}/gender.history.param"
- "${m}/gender.history.results.html"
- "${m}/genre_dortmund.history"
- "${m}/genre_dortmund.history.param"
- "${m}/genre_dortmund.history.results.html"
- "${m}/genre_electronic.history"
- "${m}/genre_electronic.history.param"
- "${m}/genre_electronic.history.results.html"
- "${m}/genre_rosamerica.history"
- "${m}/genre_rosamerica.history.param"
- "${m}/genre_rosamerica.history.results.html"
- "${m}/genre_tzanetakis.history"
- "${m}/genre_tzanetakis.history.param"
- "${m}/genre_tzanetakis.history.results.html"
- "${m}/ismir04_rhythm.history"
- "${m}/ismir04_rhythm.history.param"
- "${m}/ismir04_rhythm.history.results.html"
- "${m}/mood_acoustic.history"
- "${m}/mood_acoustic.history.param"
- "${m}/mood_acoustic.history.results.html"
- "${m}/mood_aggressive.history"
- "${m}/mood_aggressive.history.param"
- "${m}/mood_aggressive.history.results.html"
- "${m}/mood_electronic.history"
- "${m}/mood_electronic.history.param"
- "${m}/mood_electronic.history.results.html"
- "${m}/mood_happy.history"
- "${m}/mood_happy.history.param"
- "${m}/mood_happy.history.results.html"
- "${m}/mood_party.history"
- "${m}/mood_party.history.param"
- "${m}/mood_party.history.results.html"
- "${m}/mood_relaxed.history"
- "${m}/mood_relaxed.history.param"
- "${m}/mood_relaxed.history.results.html"
- "${m}/mood_sad.history"
- "${m}/mood_sad.history.param"
- "${m}/mood_sad.history.results.html"
- "${m}/moods_mirex.history"
- "${m}/moods_mirex.history.param"
- "${m}/moods_mirex.history.results.html"
- "${m}/timbre.history"
- "${m}/timbre.history.param"
- "${m}/timbre.history.results.html"
- "${m}/tonal_atonal.history"
- "${m}/tonal_atonal.history.param"
- "${m}/tonal_atonal.history.results.html"
- "${m}/voice_instrumental.history"
- "${m}/voice_instrumental.history.param"
- "${m}/voice_instrumental.history.results.html"
- ];
- };
- };
- };
- hook = {
- hooks = [
- {
- event = "import";
- command = "echo Remember to run 'beet xtractor'!";
- }
- ];
- };
- };
-}
diff --git a/modules/home/conf/beets/replace_override.yaml b/modules/home/conf/beets/replace_override.yaml
deleted file mode 100644
index 23d6ea55..00000000
--- a/modules/home/conf/beets/replace_override.yaml
+++ /dev/null
@@ -1,10 +0,0 @@
----
-replace:
- '[\\/]': _
- '^\.': _
- '[\x00-\x1f]': _
- '[<>:"\?\*\|]': _
- '\.$': _
- '\s+$': ''
- '^\s+': ''
- '^-': _