mirror of
https://github.com/nix-community/home-manager
synced 2024-11-18 17:19:45 +01:00
5427f3d1f0
If the user has enabled the XDG user directories module then we can use the XDG music directory in the MPD module. Otherwise we'll leave the option undefined so that the user is forced to define the directory to use. This applies to state version 22.11 and above. Fixes #3225
24 lines
508 B
Nix
24 lines
508 B
Nix
{ ... }:
|
|
|
|
{
|
|
services.mpdris2 = {
|
|
enable = true;
|
|
mpd = {
|
|
host = "somehost";
|
|
port = 42;
|
|
password = "foo";
|
|
};
|
|
};
|
|
|
|
services.mpd.musicDirectory = "/home/hm-user/music";
|
|
|
|
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}
|
|
'';
|
|
}
|