diff --git a/tests/default.nix b/tests/default.nix index 346217565..7287bc41b 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -148,6 +148,7 @@ import nmt { ./modules/services/home-manager-auto-upgrade ./modules/services/kanshi ./modules/services/lieer + ./modules/services/mpd ./modules/services/pantalaimon ./modules/services/pbgopy ./modules/services/playerctld diff --git a/tests/modules/services/mpd/basic-configuration.conf b/tests/modules/services/mpd/basic-configuration.conf new file mode 100644 index 000000000..54d6059fa --- /dev/null +++ b/tests/modules/services/mpd/basic-configuration.conf @@ -0,0 +1,11 @@ +music_directory "/home/hm-user/music" +playlist_directory "/home/hm-user/.local/share/mpd/playlists" +db_file "/home/hm-user/.local/share/mpd/tag_cache" + +state_file "/home/hm-user/.local/share/mpd/state" +sticker_file "/home/hm-user/.local/share/mpd/sticker.sql" + +bind_to_address "127.0.0.1" + + + diff --git a/tests/modules/services/mpd/basic-configuration.nix b/tests/modules/services/mpd/basic-configuration.nix new file mode 100644 index 000000000..c1f288980 --- /dev/null +++ b/tests/modules/services/mpd/basic-configuration.nix @@ -0,0 +1,19 @@ +{ config, lib, pkgs, ... }: + +with lib; + +{ + services.mpd.enable = true; + + 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) + assertFileContent "$confFile" ${./basic-configuration.conf} + ''; +} diff --git a/tests/modules/services/mpd/basic-configuration.service b/tests/modules/services/mpd/basic-configuration.service new file mode 100644 index 000000000..146790363 --- /dev/null +++ b/tests/modules/services/mpd/basic-configuration.service @@ -0,0 +1,13 @@ +[Install] +WantedBy=default.target + +[Service] +Environment=PATH=/home/hm-user/.nix-profile/bin +ExecStart=@mpd@/bin/mpd --no-daemon /nix/store/00000000000000000000000000000000-mpd.conf +ExecStartPre=/nix/store/00000000000000000000000000000000-bash-5.1-p12/bin/bash -c "/nix/store/00000000000000000000000000000000-coreutils-9.0/bin/mkdir -p '/home/hm-user/.local/share/mpd' '/home/hm-user/.local/share/mpd/playlists'" +Type=notify + +[Unit] +After=network.target +After=sound.target +Description=Music Player Daemon diff --git a/tests/modules/services/mpd/default.nix b/tests/modules/services/mpd/default.nix new file mode 100644 index 000000000..22d1638e5 --- /dev/null +++ b/tests/modules/services/mpd/default.nix @@ -0,0 +1 @@ +{ mpd-basic-configuration = ./basic-configuration.nix; }