djangonix/utils/mkManagePy.nix
2024-06-09 15:20:20 +02:00

20 lines
351 B
Nix

{
pkgs,
lib,
writeShellApplication,
}:
{
app,
pythonPackage,
manageFilePath,
src,
}:
writeShellApplication {
name = "manage-${app}";
runtimeInputs = [ pythonPackage ];
text = ''
PYTHON_PATH=${src} \
DJANGO_SETTINGS_MODULE=''${DJANGO_SETTINGS_MODULE:=${app}_settings.prod} \
python ${src}/${manageFilePath} "$@"
'';
}