1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-30 06:59:45 +01:00

mpd: add basic test case

This commit is contained in:
Robert Helgesson 2022-03-04 00:43:40 +01:00
parent e58a7cb13d
commit 541874f55d
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
5 changed files with 45 additions and 0 deletions

View file

@ -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

View file

@ -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"

View file

@ -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}
'';
}

View file

@ -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

View file

@ -0,0 +1 @@
{ mpd-basic-configuration = ./basic-configuration.nix; }