mirror of
https://github.com/nix-community/home-manager
synced 2024-12-05 01:19:46 +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
527 B
Nix
24 lines
527 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
{
|
|
services.mpd.enable = true;
|
|
|
|
home.stateVersion = "18.09";
|
|
|
|
test.stubs.mpd = { };
|
|
|
|
nmt.script = ''
|
|
serviceFile=$(normalizeStorePaths home-files/.config/systemd/user/mpd.service)
|
|
assertFileContent "$serviceFile" ${./basic-configuration.service}
|
|
|
|
confFile=$(grep -o \
|
|
'/nix/store/.*-mpd.conf' \
|
|
$TESTED/home-files/.config/systemd/user/mpd.service)
|
|
|
|
assertFileContains \
|
|
"$confFile" \
|
|
'music_directory "/home/hm-user/music"'
|
|
'';
|
|
}
|