mirror of
https://github.com/nix-community/home-manager.git
synced 2024-12-14 11:57:55 +00:00
mopidy: make scan service depend on mopidy-local
This commit is contained in:
parent
15d7ec3051
commit
d939ce585c
4 changed files with 23 additions and 3 deletions
|
@ -48,6 +48,8 @@ let
|
||||||
configFilePaths = concatStringsSep ":"
|
configFilePaths = concatStringsSep ":"
|
||||||
([ "${config.xdg.configHome}/mopidy/mopidy.conf" ] ++ cfg.extraConfigFiles);
|
([ "${config.xdg.configHome}/mopidy/mopidy.conf" ] ++ cfg.extraConfigFiles);
|
||||||
|
|
||||||
|
hasMopidyLocal = builtins.elem pkgs.mopidy-local cfg.extensionPackages;
|
||||||
|
|
||||||
in {
|
in {
|
||||||
meta.maintainers = [ hm.maintainers.foo-dogsquared ];
|
meta.maintainers = [ hm.maintainers.foo-dogsquared ];
|
||||||
|
|
||||||
|
@ -133,7 +135,7 @@ in {
|
||||||
Install.WantedBy = [ "default.target" ];
|
Install.WantedBy = [ "default.target" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.user.services.mopidy-scan = {
|
systemd.user.services.mopidy-scan = mkIf hasMopidyLocal {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "mopidy local files scanner";
|
Description = "mopidy local files scanner";
|
||||||
Documentation = [ "https://mopidy.com/" ];
|
Documentation = [ "https://mopidy.com/" ];
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
{
|
{
|
||||||
services.mopidy = {
|
services.mopidy = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
extensionPackages = [ ];
|
||||||
settings = {
|
settings = {
|
||||||
file = {
|
file = {
|
||||||
enabled = true;
|
enabled = true;
|
||||||
|
@ -29,7 +30,7 @@
|
||||||
|
|
||||||
nmt.script = ''
|
nmt.script = ''
|
||||||
assertFileExists home-files/.config/systemd/user/mopidy.service
|
assertFileExists home-files/.config/systemd/user/mopidy.service
|
||||||
assertFileExists home-files/.config/systemd/user/mopidy-scan.service
|
assertPathNotExists home-files/.config/systemd/user/mopidy-scan.service
|
||||||
|
|
||||||
assertFileExists home-files/.config/mopidy/mopidy.conf
|
assertFileExists home-files/.config/mopidy/mopidy.conf
|
||||||
assertFileContent home-files/.config/mopidy/mopidy.conf \
|
assertFileContent home-files/.config/mopidy/mopidy.conf \
|
||||||
|
|
|
@ -1 +1,5 @@
|
||||||
{ mopidy-basic-configuration = ./basic-configuration.nix; }
|
{
|
||||||
|
mopidy-basic-configuration = ./basic-configuration.nix;
|
||||||
|
mopidy-scan = ./mopidy-scan.nix;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
13
tests/modules/services/mopidy/mopidy-scan.nix
Normal file
13
tests/modules/services/mopidy/mopidy-scan.nix
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
services.mopidy = {
|
||||||
|
enable = true;
|
||||||
|
extensionPackages = [ pkgs.mopidy-local ];
|
||||||
|
};
|
||||||
|
|
||||||
|
nmt.script = ''
|
||||||
|
assertFileExists home-files/.config/systemd/user/mopidy.service
|
||||||
|
assertFileExists home-files/.config/systemd/user/mopidy-scan.service
|
||||||
|
'';
|
||||||
|
}
|
Loading…
Reference in a new issue