buildMix: default to removing target config (#430275)
This commit is contained in:
commit
1b240ff169
@ -25,12 +25,15 @@
|
|||||||
meta ? { },
|
meta ? { },
|
||||||
enableDebugInfo ? false,
|
enableDebugInfo ? false,
|
||||||
mixEnv ? "prod",
|
mixEnv ? "prod",
|
||||||
|
removeConfig ? true,
|
||||||
# A config directory that is considered for all the dependencies of an app, typically in $src/config/
|
# A config directory that is considered for all the dependencies of an app, typically in $src/config/
|
||||||
# This was initially added, as some of Mobilizon's dependencies need to access the config at build time.
|
# This was initially added, as some of Mobilizon's dependencies need to access the config at build time.
|
||||||
appConfigPath ? null,
|
appConfigPath ? null,
|
||||||
...
|
...
|
||||||
}@attrs:
|
}@attrs:
|
||||||
|
|
||||||
|
assert appConfigPath != null -> removeConfig;
|
||||||
|
|
||||||
let
|
let
|
||||||
shell =
|
shell =
|
||||||
drv:
|
drv:
|
||||||
@ -79,10 +82,17 @@ let
|
|||||||
runHook preConfigure
|
runHook preConfigure
|
||||||
|
|
||||||
${./mix-configure-hook.sh}
|
${./mix-configure-hook.sh}
|
||||||
|
${lib.optionalString (removeConfig && isNull appConfigPath)
|
||||||
|
# By default, we don't want to include whatever config a dependency brings; per
|
||||||
|
# https://hexdocs.pm/elixir/main/Config.html, config is application specific.
|
||||||
|
''
|
||||||
|
rm -rf config
|
||||||
|
mkdir config
|
||||||
|
''
|
||||||
|
}
|
||||||
${lib.optionalString (!isNull appConfigPath)
|
${lib.optionalString (!isNull appConfigPath)
|
||||||
# Due to https://hexdocs.pm/elixir/main/Config.html the config directory
|
# Some more tightly-coupled dependencies do depend on the config of the application
|
||||||
# of a library seems to be not considered, as config is always
|
# they're being built for.
|
||||||
# application specific. So we can safely delete it.
|
|
||||||
''
|
''
|
||||||
rm -rf config
|
rm -rf config
|
||||||
cp -r ${appConfigPath} config
|
cp -r ${appConfigPath} config
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user