2020-10-12 00:22:58 +00:00
|
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
|
|
cfg = config.programs.beets;
|
|
|
|
|
|
2021-07-02 22:36:30 +00:00
|
|
|
|
yamlFormat = pkgs.formats.yaml { };
|
|
|
|
|
|
2020-10-12 00:22:58 +00:00
|
|
|
|
in {
|
|
|
|
|
meta.maintainers = [ maintainers.rycee ];
|
|
|
|
|
|
|
|
|
|
options = {
|
|
|
|
|
programs.beets = {
|
|
|
|
|
enable = mkOption {
|
|
|
|
|
type = types.bool;
|
|
|
|
|
default = if versionAtLeast config.home.stateVersion "19.03" then
|
|
|
|
|
false
|
|
|
|
|
else
|
|
|
|
|
cfg.settings != { };
|
|
|
|
|
defaultText = "false";
|
|
|
|
|
description = ''
|
|
|
|
|
Whether to enable the beets music library manager. This
|
|
|
|
|
defaults to <literal>false</literal> for state
|
|
|
|
|
version ≥ 19.03. For earlier versions beets is enabled if
|
|
|
|
|
<option>programs.beets.settings</option> is non-empty.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
package = mkOption {
|
|
|
|
|
type = types.package;
|
|
|
|
|
default = pkgs.beets;
|
2021-11-04 16:42:44 +00:00
|
|
|
|
defaultText = literalExpression "pkgs.beets";
|
2020-10-12 00:22:58 +00:00
|
|
|
|
example =
|
2021-11-04 16:42:44 +00:00
|
|
|
|
literalExpression "(pkgs.beets.override { enableCheck = true; })";
|
2020-10-12 00:22:58 +00:00
|
|
|
|
description = ''
|
|
|
|
|
The <literal>beets</literal> package to use.
|
|
|
|
|
Can be used to specify extensions.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
settings = mkOption {
|
2021-07-02 22:36:30 +00:00
|
|
|
|
type = yamlFormat.type;
|
2020-10-12 00:22:58 +00:00
|
|
|
|
default = { };
|
|
|
|
|
description = ''
|
|
|
|
|
Configuration written to
|
|
|
|
|
<filename>~/.config/beets/config.yaml</filename>
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
|
home.packages = [ cfg.package ];
|
|
|
|
|
|
2021-07-02 22:36:30 +00:00
|
|
|
|
xdg.configFile."beets/config.yaml".source =
|
|
|
|
|
yamlFormat.generate "beets-config" cfg.settings;
|
2020-10-12 00:22:58 +00:00
|
|
|
|
};
|
|
|
|
|
}
|