1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-14 15:19:45 +01:00
home-manager/modules/programs/beets.nix

60 lines
1.4 KiB
Nix
Raw Normal View History

2017-01-07 19:16:26 +01:00
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.beets;
in
{
meta.maintainers = [ maintainers.rycee ];
2017-01-07 19:16:26 +01:00
options = {
programs.beets = {
2018-12-04 23:00:11 +01:00
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.
'';
};
2019-12-18 01:25:52 +01:00
package = mkOption {
type = types.package;
default = pkgs.beets;
defaultText = literalExample "pkgs.beets";
example = literalExample "(pkgs.beets.override { enableCheck = true; })";
description = ''
The <literal>beets</literal> package to use.
Can be used to specify extensions.
'';
};
2017-01-07 19:16:26 +01:00
settings = mkOption {
type = types.attrs;
default = {};
2017-01-15 20:03:55 +01:00
description = ''
Configuration written to
<filename>~/.config/beets/config.yaml</filename>
'';
2017-01-07 19:16:26 +01:00
};
};
};
2018-12-04 23:00:11 +01:00
config = mkIf cfg.enable {
2019-12-18 01:25:52 +01:00
home.packages = [ cfg.package ];
2017-01-07 19:16:26 +01:00
xdg.configFile."beets/config.yaml".text =
2017-01-07 19:16:26 +01:00
builtins.toJSON config.programs.beets.settings;
};
}