From 569c258e513ffa1da3dc11662bff414904675d10 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 6 Aug 2022 14:05:34 +0800 Subject: [PATCH] users/foo-dogsquared: more music player setup --- users/home-manager/foo-dogsquared/default.nix | 69 ++++++++++++++++++- 1 file changed, 67 insertions(+), 2 deletions(-) diff --git a/users/home-manager/foo-dogsquared/default.nix b/users/home-manager/foo-dogsquared/default.nix index 4c71bfbd..2d8e5589 100644 --- a/users/home-manager/foo-dogsquared/default.nix +++ b/users/home-manager/foo-dogsquared/default.nix @@ -21,6 +21,9 @@ let ${pkgs.yt-dlp}/bin/yt-dlp --config-location "${yt-dlp-for-audio-config}" $@ ''; getDotfiles = path: "${inputs.dotfiles}/${path}"; + + musicDir = config.xdg.userDirs.music; + playlistsDir = "${musicDir}/playlists"; in { programs.home-manager.enable = true; @@ -45,7 +48,7 @@ in { fi ''; - # My specific usual stuff. + # My Git credentials. programs.git = let email = "foo.dogsquared@gmail.com"; in { enable = true; package = pkgs.gitFull; @@ -65,6 +68,55 @@ in { }; # My music player setup, completely configured with Nix! + programs.beets = { + enable = true; + settings = { + library = "${musicDir}/library.db"; + plugins = [ + "acousticbrainz" + "chroma" + "deezer" + "edit" + "export" + "fuzzy" + "playlist" + "scrub" + "smartplaylist" + "spotify" + ]; + ignore_hidden = "yes"; + directory = musicDir; + ui.colors = "yes"; + + import = { + link = "no"; + resume = "yes"; + incremental = "yes"; + group_albums = "yes"; + log = "beets.log"; + }; + + match = { + required = "year label"; + ignore_video_tracks = "yes"; + }; + + # Plugins configuration. + fuzzy.prefix = "-"; + scrub.auto = "yes"; + smartplaylist = { + relative_to = musicDir; + playlist_dir = playlistsDir; + playlists = [ + { + name = "all.m3u8"; + query = ""; + } + ]; + }; + }; + }; + services.mopidy = { enable = true; extensionPackages = with pkgs; [ @@ -103,11 +155,21 @@ in { "audio_foreign" ]; }; + + m3u = { + enabled = true; + base_dir = musicDir; + playlists_dir = playlistsDir; + default_encoding = "utf-8"; + default_extension = ".m3u8"; + }; }; }; + # My preferred file indexing service. services.recoll = { enable = true; + startAt = "daily"; settings = { topdirs = "~/Downloads ~/Documents ~/library"; "skippedNames+" = "node_modules"; @@ -139,7 +201,10 @@ in { research.enable = true; }; - services.bleachbit.enable = true; + services.bleachbit = { + enable = true; + withChatCleanup = true; + }; systemd.user.sessionVariables = { MANPAGER = "nvim +Man!";