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:
parent
e58a7cb13d
commit
541874f55d
5 changed files with 45 additions and 0 deletions
|
@ -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
|
||||
|
|
11
tests/modules/services/mpd/basic-configuration.conf
Normal file
11
tests/modules/services/mpd/basic-configuration.conf
Normal 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"
|
||||
|
||||
|
||||
|
19
tests/modules/services/mpd/basic-configuration.nix
Normal file
19
tests/modules/services/mpd/basic-configuration.nix
Normal 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}
|
||||
'';
|
||||
}
|
13
tests/modules/services/mpd/basic-configuration.service
Normal file
13
tests/modules/services/mpd/basic-configuration.service
Normal 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
|
1
tests/modules/services/mpd/default.nix
Normal file
1
tests/modules/services/mpd/default.nix
Normal file
|
@ -0,0 +1 @@
|
|||
{ mpd-basic-configuration = ./basic-configuration.nix; }
|
Loading…
Reference in a new issue