mirror of
https://github.com/nix-community/home-manager.git
synced 2025-12-15 05:21:06 +01:00
mopidy: add module
This is adapted from the `services.mopidy` NixOS module. The difference is the setting can be configured with Nix language, taking advantage of generators from nixpkgs. The module is also suited more for user-specific configuration, removing the `extraConfigFiles` and `dataDir` option.
This commit is contained in:
parent
32a7da69dc
commit
cb9f03d519
9 changed files with 204 additions and 0 deletions
38
tests/modules/services/mopidy/basic-configuration.nix
Normal file
38
tests/modules/services/mopidy/basic-configuration.nix
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
services.mopidy = {
|
||||
enable = true;
|
||||
settings = {
|
||||
file = {
|
||||
enabled = true;
|
||||
media_dirs = [ "$XDG_MUSIC_DIR|Music" "~/Downloads|Downloads" ];
|
||||
};
|
||||
|
||||
spotify = {
|
||||
enabled = true;
|
||||
client_id = "TOTALLY_NOT_A_FAKE_CLIENT_ID";
|
||||
client_secret = "YOU_CAN_USE_ME_FOR_YOUR_SPOTIFY_PREMIUM_SUBSCRIPTION";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
test.stubs.mopidy = {
|
||||
version = "0";
|
||||
outPath = null;
|
||||
buildScript = ''
|
||||
mkdir -p $out/bin
|
||||
touch $out/bin/mopidy
|
||||
chmod +x $out/bin/mopidy
|
||||
'';
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.config/systemd/user/mopidy.service
|
||||
assertFileExists home-files/.config/systemd/user/mopidy-scan.service
|
||||
|
||||
assertFileExists home-files/.config/mopidy/mopidy.conf
|
||||
assertFileContent home-files/.config/mopidy/mopidy.conf \
|
||||
${./basic-configuration.conf}
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue