1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-26 21:19:45 +01:00

mpdris2: add basic test cases

This commit is contained in:
Robert Helgesson 2022-05-25 18:31:08 +02:00
parent 9042c756fa
commit 2c8489e57a
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
7 changed files with 76 additions and 0 deletions

View file

@ -155,6 +155,7 @@ import nmt {
./modules/services/lieer
./modules/services/mopidy
./modules/services/mpd
./modules/services/mpdris2
./modules/services/pantalaimon
./modules/services/pbgopy
./modules/services/picom

View file

@ -0,0 +1,8 @@
[Bling]
mmkeys = True
notify = True
[Connection]
host = 127.0.0.1
music_dir = /home/hm-user/music
port = 6600

View file

@ -0,0 +1,19 @@
{ ... }:
{
services.mpdris2 = {
enable = true;
notifications = true;
multimediaKeys = true;
};
test.stubs.mpdris2 = { };
nmt.script = ''
serviceFile=home-files/.config/systemd/user/mpdris2.service
assertFileContent "$serviceFile" ${./basic-configuration.service}
configFile=home-files/.config/mpDris2/mpDris2.conf
assertFileContent "$configFile" ${./basic-configuration.config}
'';
}

View file

@ -0,0 +1,13 @@
[Install]
WantedBy=default.target
[Service]
BusName=org.mpris.MediaPlayer2.mpd
ExecStart=@mpdris2@/bin/mpDris2
Restart=on-failure
RestartSec=5s
Type=simple
[Unit]
After=mpd.service
Description=MPRIS 2 support for MPD

View file

@ -0,0 +1,4 @@
{
mpdris2-basic-configuration = ./basic-configuration.nix;
mpdris2-with-password = ./with-password.nix;
}

View file

@ -0,0 +1,9 @@
[Bling]
mmkeys = False
notify = False
[Connection]
host = somehost
music_dir = /home/hm-user/music
password = foo
port = 42

View file

@ -0,0 +1,22 @@
{ ... }:
{
services.mpdris2 = {
enable = true;
mpd = {
host = "somehost";
port = 42;
password = "foo";
};
};
test.stubs.mpdris2 = { };
nmt.script = ''
serviceFile=home-files/.config/systemd/user/mpdris2.service
assertFileContent "$serviceFile" ${./basic-configuration.service}
configFile=home-files/.config/mpDris2/mpDris2.conf
assertFileContent "$configFile" ${./with-password.config}
'';
}