mirror of
https://github.com/nix-community/home-manager
synced 2025-01-11 19:49:49 +01:00
mopidy: add support for extraConfigFiles
This commit is contained in:
parent
60b064249d
commit
ce563f5911
1 changed files with 18 additions and 2 deletions
|
@ -45,6 +45,9 @@ let
|
||||||
|
|
||||||
settingsFormat = mopidyConfFormat { };
|
settingsFormat = mopidyConfFormat { };
|
||||||
|
|
||||||
|
configFilePaths = concatStringsSep ":"
|
||||||
|
([ "${config.xdg.configHome}/mopidy/mopidy.conf" ] ++ cfg.extraConfigFiles);
|
||||||
|
|
||||||
in {
|
in {
|
||||||
meta.maintainers = [ hm.maintainers.foo-dogsquared ];
|
meta.maintainers = [ hm.maintainers.foo-dogsquared ];
|
||||||
|
|
||||||
|
@ -97,6 +100,16 @@ in {
|
||||||
more details.
|
more details.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
extraConfigFiles = mkOption {
|
||||||
|
default = [ ];
|
||||||
|
type = types.listOf types.path;
|
||||||
|
description = ''
|
||||||
|
Extra configuration files read by Mopidy when the service starts.
|
||||||
|
Later files in the list override earlier configuration files and
|
||||||
|
structured settings.
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
@ -113,7 +126,9 @@ in {
|
||||||
After = [ "network.target" "sound.target" ];
|
After = [ "network.target" "sound.target" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
Service = { ExecStart = "${mopidyEnv}/bin/mopidy"; };
|
Service = {
|
||||||
|
ExecStart = "${mopidyEnv}/bin/mopidy --config ${configFilePaths}";
|
||||||
|
};
|
||||||
|
|
||||||
Install.WantedBy = [ "default.target" ];
|
Install.WantedBy = [ "default.target" ];
|
||||||
};
|
};
|
||||||
|
@ -126,7 +141,8 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
Service = {
|
Service = {
|
||||||
ExecStart = "${mopidyEnv}/bin/mopidy local scan";
|
ExecStart =
|
||||||
|
"${mopidyEnv}/bin/mopidy --config ${configFilePaths} local scan";
|
||||||
Type = "oneshot";
|
Type = "oneshot";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue