2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
fetchFromGitHub,
|
|
|
|
fetchNpmDeps,
|
|
|
|
buildPythonPackage,
|
|
|
|
nix-update-script,
|
2023-05-24 13:37:59 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
# build-system
|
2024-07-27 06:49:29 +00:00
|
|
|
flit-gettext,
|
|
|
|
flit-scm,
|
2024-06-05 15:53:02 +00:00
|
|
|
nodejs,
|
|
|
|
npmHooks,
|
2023-05-24 13:37:59 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
# dependencies
|
|
|
|
django,
|
2023-05-24 13:37:59 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
# tests
|
|
|
|
pytest-django,
|
|
|
|
pytestCheckHook,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
2022-04-27 09:35:20 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "django-hijack";
|
2024-10-04 16:56:33 +00:00
|
|
|
version = "3.6.1";
|
2024-07-27 06:49:29 +00:00
|
|
|
pyproject = true;
|
2023-05-24 13:37:59 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "django-hijack";
|
|
|
|
repo = "django-hijack";
|
|
|
|
rev = "refs/tags/${version}";
|
2024-10-04 16:56:33 +00:00
|
|
|
hash = "sha256-xnRVoCs+TyAbvFSBD58MJhwLw7ecKpMFuWewAgmnzqk=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
postPatch = ''
|
2024-07-27 06:49:29 +00:00
|
|
|
sed -i "/addopts/d" pyproject.toml
|
2023-05-24 13:37:59 +00:00
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
# missing integrity hashes for yocto-queue, yargs-parser
|
|
|
|
cp ${./package-lock.json} package-lock.json
|
2023-05-24 13:37:59 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
npmDeps = fetchNpmDeps {
|
2024-07-27 06:49:29 +00:00
|
|
|
inherit src postPatch;
|
|
|
|
hash = "sha256-npAFpdqGdttE4facBimS/y2SqwnCvOHJhd60SPR/IaA=";
|
2023-05-24 13:37:59 +00:00
|
|
|
};
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
build-system = [
|
|
|
|
flit-gettext
|
|
|
|
flit-scm
|
2023-05-24 13:37:59 +00:00
|
|
|
nodejs
|
|
|
|
npmHooks.npmConfigHook
|
|
|
|
];
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
dependencies = [ django ];
|
2023-01-11 07:51:40 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2023-01-11 07:51:40 +00:00
|
|
|
pytestCheckHook
|
|
|
|
pytest-django
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
preCheck = ''
|
2024-09-19 14:19:46 +00:00
|
|
|
export DJANGO_SETTINGS_MODULE=tests.test_app.settings
|
2024-07-27 06:49:29 +00:00
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
# needed for npmDeps update
|
|
|
|
passthru.updateScript = nix-update-script { };
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Allows superusers to hijack (=login as) and work on behalf of another user";
|
2024-07-27 06:49:29 +00:00
|
|
|
homepage = "https://github.com/django-hijack/django-hijack";
|
2023-01-11 07:51:40 +00:00
|
|
|
changelog = "https://github.com/django-hijack/django-hijack/releases/tag/${version}";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ ris ];
|
|
|
|
};
|
|
|
|
}
|