Beets, initial commit
Sets up beets with my preferred defaults. Configures the program for the following plugins: - embedart - fetchart - ftintitle - info - lyrics - the
This commit is contained in:
parent
544bb630a0
commit
09ae6daec0
1 changed files with 52 additions and 0 deletions
52
hmModules/apps/beets/app.nix
Normal file
52
hmModules/apps/beets/app.nix
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
options.beets = {
|
||||
enable = lib.mkEnableOption "Enables beets music";
|
||||
plugins = {
|
||||
the.enable = lib.mkOption { default = true; };
|
||||
ftintitle.enable = lib.mkOption { default = true; };
|
||||
lyrics.enable = lib.mkOption { default = true; };
|
||||
fetchart = {
|
||||
enable = lib.mkOption { default = true; };
|
||||
embed = lib.mkOption { default = true; };
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf config.beets.enable {
|
||||
programs.beets.enable = true;
|
||||
|
||||
programs.beets.settings = {
|
||||
directory = "${config.xdg.userDirs.music}";
|
||||
library = "${config.xdg.userDirs.music}.db";
|
||||
|
||||
paths.default = with config.beets.plugins; let
|
||||
# raw_artist = if ftintitle.enable
|
||||
# then "$album_artist_no_feat"
|
||||
# else "$albumartist";
|
||||
raw_artist = "$albumartist";
|
||||
artist = if the.enable
|
||||
then "%the{${raw_artist}}/"
|
||||
else raw_artist;
|
||||
|
||||
the_rest = "$album%aunique{}/$track $title";
|
||||
in artist + the_rest;
|
||||
|
||||
embedart = with config.beets.plugins.fetchart;
|
||||
lib.mkIf (enable && embed) {
|
||||
maxwidth = 500;
|
||||
};
|
||||
|
||||
plugins = with lib; with config.beets.plugins;
|
||||
optional (the.enable) "the" ++
|
||||
optional (ftintitle.enable) "ftintitle" ++
|
||||
optional (lyrics.enable) "lyrics" ++
|
||||
optional (fetchart.enable) "fetchart" ++
|
||||
optional (fetchart.embed) "embedart" ++ [
|
||||
"musicbrainz"
|
||||
"info"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue