beets: minor fixes
This commit is contained in:
parent
8345a3166d
commit
caa47705f7
|
@ -51,19 +51,22 @@ in {
|
||||||
|
|
||||||
mpdIntegration = {
|
mpdIntegration = {
|
||||||
enableStats = mkEnableOption "mpdstats plugin and service";
|
enableStats = mkEnableOption "mpdstats plugin and service";
|
||||||
|
|
||||||
enableUpdate = mkEnableOption "mpdupdate plugin";
|
enableUpdate = mkEnableOption "mpdupdate plugin";
|
||||||
|
|
||||||
host = mkOption {
|
host = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
default = "localhost";
|
default = "localhost";
|
||||||
description = "Host mpdstats will connect to";
|
|
||||||
example = "10.0.0.42";
|
example = "10.0.0.42";
|
||||||
|
description = "The host that mpdstats will connect to.";
|
||||||
};
|
};
|
||||||
|
|
||||||
port = mkOption {
|
port = mkOption {
|
||||||
type = types.port;
|
type = types.port;
|
||||||
default = config.services.mpd.network.port;
|
default = config.services.mpd.network.port;
|
||||||
defaultText = literalExpression "config.services.mpd.network.port";
|
defaultText = literalExpression "config.services.mpd.network.port";
|
||||||
description = "Port mpdstats will connect to";
|
|
||||||
example = 6601;
|
example = 6601;
|
||||||
|
description = "The port that mpdstats will connect to.";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -76,18 +79,22 @@ in {
|
||||||
xdg.configFile."beets/config.yaml".source =
|
xdg.configFile."beets/config.yaml".source =
|
||||||
yamlFormat.generate "beets-config" cfg.settings;
|
yamlFormat.generate "beets-config" cfg.settings;
|
||||||
})
|
})
|
||||||
|
|
||||||
(mkIf (cfg.mpdIntegration.enableStats || cfg.mpdIntegration.enableUpdate) {
|
(mkIf (cfg.mpdIntegration.enableStats || cfg.mpdIntegration.enableUpdate) {
|
||||||
programs.beets.settings.mpd = {
|
programs.beets.settings.mpd = {
|
||||||
host = cfg.mpdIntegration.host;
|
host = cfg.mpdIntegration.host;
|
||||||
port = cfg.mpdIntegration.port;
|
port = cfg.mpdIntegration.port;
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
|
|
||||||
(mkIf cfg.mpdIntegration.enableStats {
|
(mkIf cfg.mpdIntegration.enableStats {
|
||||||
programs.beets.settings.plugins = [ "mpdstats" ];
|
programs.beets.settings.plugins = [ "mpdstats" ];
|
||||||
})
|
})
|
||||||
|
|
||||||
(mkIf cfg.mpdIntegration.enableUpdate {
|
(mkIf cfg.mpdIntegration.enableUpdate {
|
||||||
programs.beets.settings.plugins = [ "mpdupdate" ];
|
programs.beets.settings.plugins = [ "mpdupdate" ];
|
||||||
})
|
})
|
||||||
|
|
||||||
(mkIf (cfg.enable && cfg.mpdIntegration.enableStats) {
|
(mkIf (cfg.enable && cfg.mpdIntegration.enableStats) {
|
||||||
systemd.user.services."beets-mpdstats" = {
|
systemd.user.services."beets-mpdstats" = {
|
||||||
Unit = {
|
Unit = {
|
||||||
|
|
Loading…
Reference in a new issue