mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-25 20:34:52 +03:00
mopidy module: use buildEnv fixes #11706
This commit is contained in:
parent
4446b078fc
commit
3bc477e2f2
@ -11,17 +11,8 @@ let
|
||||
|
||||
mopidyConf = writeText "mopidy.conf" cfg.configuration;
|
||||
|
||||
mopidyLauncher = stdenv.mkDerivation {
|
||||
name = "mopidy-launcher";
|
||||
phases = [ "installPhase" ];
|
||||
buildInputs = [ makeWrapper python ];
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
ln -s ${mopidy}/bin/mopidy $out/bin/mopidy
|
||||
wrapProgram $out/bin/mopidy \
|
||||
--prefix PYTHONPATH : \
|
||||
"${concatStringsSep ":" (map (p: "$(toPythonPath ${p})") cfg.extensionPackages)}"
|
||||
'';
|
||||
mopidyEnv = python.buildEnv.override {
|
||||
extraLibs = [ mopidy ] ++ cfg.extensionPackages;
|
||||
};
|
||||
|
||||
in {
|
||||
@ -86,7 +77,7 @@ in {
|
||||
description = "mopidy music player daemon";
|
||||
preStart = "mkdir -p ${cfg.dataDir} && chown -R mopidy:mopidy ${cfg.dataDir}";
|
||||
serviceConfig = {
|
||||
ExecStart = "${mopidyLauncher}/bin/mopidy --config ${concatStringsSep ":" ([mopidyConf] ++ cfg.extraConfigFiles)}";
|
||||
ExecStart = "${mopidyEnv}/bin/mopidy --config ${concatStringsSep ":" ([mopidyConf] ++ cfg.extraConfigFiles)}";
|
||||
User = "mopidy";
|
||||
PermissionsStartOnly = true;
|
||||
};
|
||||
@ -96,7 +87,7 @@ in {
|
||||
description = "mopidy local files scanner";
|
||||
preStart = "mkdir -p ${cfg.dataDir} && chown -R mopidy:mopidy ${cfg.dataDir}";
|
||||
serviceConfig = {
|
||||
ExecStart = "${mopidyLauncher}/bin/mopidy --config ${concatStringsSep ":" ([mopidyConf] ++ cfg.extraConfigFiles)} local scan";
|
||||
ExecStart = "${mopidyEnv}/bin/mopidy --config ${concatStringsSep ":" ([mopidyConf] ++ cfg.extraConfigFiles)} local scan";
|
||||
User = "mopidy";
|
||||
PermissionsStartOnly = true;
|
||||
Type = "oneshot";
|
||||
|
Loading…
Reference in New Issue
Block a user