beets: add mpdIntegration (#3755)

Allow configuration of mpdstats and mpdupdate plugins for Beets using
Home Manager.

Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
Sefa Eyeoglu 2023-05-11 14:03:54 +02:00 committed by GitHub
parent f714b17031
commit 622fa73725
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 170 additions and 7 deletions

View file

@ -0,0 +1,5 @@
{
beets-mpdstats = ./mpdstats.nix;
beets-mpdstats-external = ./mpdstats-external.nix;
beets-mpdupdate = ./mpdupdate.nix;
}

View file

@ -0,0 +1,10 @@
[Install]
WantedBy=default.target
[Service]
ExecStart=@beets@/bin/beet mpdstats
[Unit]
After=mpd.service
Description=Beets MPDStats daemon
Requires=mpd.service

View file

@ -0,0 +1,5 @@
mpd:
host: localhost
port: 4242
plugins:
- mpdstats

View file

@ -0,0 +1,8 @@
[Install]
WantedBy=default.target
[Service]
ExecStart=@beets@/bin/beet mpdstats
[Unit]
Description=Beets MPDStats daemon

View file

@ -0,0 +1,5 @@
mpd:
host: 10.0.0.42
port: 6601
plugins:
- mpdstats

View file

@ -0,0 +1,29 @@
{ config, lib, pkgs, ... }:
{
config = {
home.stateVersion = "23.05";
programs.beets = {
enable = true;
package = config.lib.test.mkStubPackage { outPath = "@beets@"; };
mpdIntegration = {
enableStats = true;
host = "10.0.0.42";
port = 6601;
};
};
nmt.script = ''
assertFileExists home-files/.config/beets/config.yaml
assertFileContent \
home-files/.config/beets/config.yaml \
${./mpdstats-external-expected.yaml}
assertFileExists home-files/.config/systemd/user/beets-mpdstats.service
assertFileContent \
home-files/.config/systemd/user/beets-mpdstats.service \
${./mpdstats-external-expected.service}
'';
};
}

View file

@ -0,0 +1,31 @@
{ config, lib, pkgs, ... }:
{
config = {
home.stateVersion = "23.05";
services.mpd = {
enable = true;
musicDirectory = "/my/music/dir";
network.port = 4242;
};
programs.beets = {
enable = true;
package = config.lib.test.mkStubPackage { outPath = "@beets@"; };
mpdIntegration.enableStats = true;
};
nmt.script = ''
assertFileExists home-files/.config/beets/config.yaml
assertFileContent \
home-files/.config/beets/config.yaml \
${./mpdstats-expected.yaml}
assertFileExists home-files/.config/systemd/user/beets-mpdstats.service
assertFileContent \
home-files/.config/systemd/user/beets-mpdstats.service \
${./mpdstats-expected.service}
'';
};
}

View file

@ -0,0 +1,5 @@
mpd:
host: localhost
port: 6600
plugins:
- mpdupdate

View file

@ -0,0 +1,20 @@
{ config, lib, pkgs, ... }:
{
config = {
home.stateVersion = "23.05";
programs.beets = {
enable = true;
package = config.lib.test.mkStubPackage { outPath = "@beets@"; };
mpdIntegration.enableUpdate = true;
};
nmt.script = ''
assertFileExists home-files/.config/beets/config.yaml
assertFileContent \
home-files/.config/beets/config.yaml \
${./mpdupdate-expected.yaml}
'';
};
}