diff options
author | shivaraj-bh <sbh69840@gmail.com> | 2024-06-13 12:21:36 +0530 |
---|---|---|
committer | shivaraj-bh <sbh69840@gmail.com> | 2024-06-13 12:21:36 +0530 |
commit | 75d7ee7d8c938fea4d36e99ef3149fad7fb80891 (patch) | |
tree | f96610cd4da46ec9e7dff5b257a2f218a1806209 /pkgs | |
parent | 521c27447b8464d9262b88d709e57239e15fc76d (diff) |
open-webui: Use `makeWrapperArgs`; Use env to disable hatch custom hook
For more info, see: - Disable hatch custom hook: https://github.com/NixOS/nixpkgs/pull/316248#discussion_r1636468561 - why `makeWrapperArgs`?: https://github.com/NixOS/nixpkgs/pull/316248#discussion_r1636483491 - `pythonRelaxDepsHook` is a nativeBuildInput: https://github.com/NixOS/nixpkgs/pull/316248#discussion_r1636477762
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/by-name/op/open-webui/package.nix | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/pkgs/by-name/op/open-webui/package.nix b/pkgs/by-name/op/open-webui/package.nix index 074c3ab90323c..353984f5fbc20 100644 --- a/pkgs/by-name/op/open-webui/package.nix +++ b/pkgs/by-name/op/open-webui/package.nix @@ -44,14 +44,14 @@ python3.pkgs.buildPythonApplication rec { inherit pname version src; pyproject = true; - # The custom hook tries to run `npm install` in `buildPhase`. - # We don't have to worry, as node dependencies are managed by `frontend` drv. + # Not force-including the frontend build directory as frontend is managed by the `frontend` derivation above. postPatch = '' substituteInPlace pyproject.toml \ - --replace-fail '[tool.hatch.build.hooks.custom]' "" \ --replace-fail ', build = "open_webui/frontend"' "" ''; + env.HATCH_BUILD_NO_HOOKS = true; + pythonRelaxDeps = true; pythonRemoveDeps = [ @@ -115,17 +115,13 @@ python3.pkgs.buildPythonApplication rec { youtube-transcript-api ]; - build-system = with python3.pkgs; [ - hatchling - pythonRelaxDepsHook - ]; + build-system = with python3.pkgs; [ hatchling ]; + + nativeBuildInputs = [ python3.pkgs.pythonRelaxDepsHook ]; pythonImportsCheck = [ "open_webui" ]; - postInstall = '' - wrapProgram $out/bin/open-webui \ - --set FRONTEND_BUILD_DIR "${frontend}/share/open-webui" - ''; + makeWrapperArgs = [ "--set FRONTEND_BUILD_DIR ${frontend}/share/open-webui" ]; passthru.tests = { inherit (nixosTests) open-webui; |