From 7dc29b09c74e4cdafaf357cdce813dd7a69d4da6 Mon Sep 17 00:00:00 2001 From: alsaiduq-lab Date: Sun, 30 Mar 2025 04:06:19 -0600 Subject: [PATCH] should work --- modules/python.nix | 2 +- pkgs/default.nix | 17 ++++++++++++----- pkgs/python-nginx-language-server/default.nix | 18 +++++++++++------- 3 files changed, 24 insertions(+), 13 deletions(-) diff --git a/modules/python.nix b/modules/python.nix index 6738909..3972d26 100644 --- a/modules/python.nix +++ b/modules/python.nix @@ -19,7 +19,7 @@ customPkgs.python-pymatting customPkgs.python-opencv-headless customPkgs.python-rembg - customPkgs.pythonPackages.numpy-1 # should force the monkeypatch'd numpy + customPkgs.pythonPackages.numpy # should force the monkeypatch'd numpy i3ipc pandas matplotlib diff --git a/pkgs/default.nix b/pkgs/default.nix index 3eac833..7686ee7 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -11,20 +11,26 @@ }; }); + customPython = pkgs.python311.override { + packageOverrides = self: super: { + numpy = numpy-1; + }; + }; + customPythonPackages = customPython.pkgs; in { + inherit numpy-1 customPythonPackages; + fish-rust = pkgs.callPackage ./fish-rust {}; python-rembg = pkgs.callPackage ./python-rembg { inherit lib; fetchPypi = pkgs.fetchPypi; - python311Packages = numpy-1; - + python311Packages = customPythonPackages; python-pymatting = pkgs.callPackage ./python-pymatting { inherit lib; fetchPypi = pkgs.fetchPypi; - python311Packages = numpy-1; + python311Packages = customPythonPackages; }; - python-opencv-headless = pkgs.callPackage ./python-opencv-headless { inherit lib; fetchPypi = pkgs.fetchPypi; @@ -32,12 +38,13 @@ in { pkg-config = pkgs.pkg-config; stdenv = pkgs.stdenv; makeWrapper = pkgs.makeWrapper; - python311Packages = numpy-1; + python311Packages = customPythonPackages; }; }; python-ngx-lsp = pkgs.callPackage ./python-nginx-language-server { inherit lib; fetchFromGitHub = pkgs.fetchFromGitHub; + python311Packages = customPythonPackages; }; } diff --git a/pkgs/python-nginx-language-server/default.nix b/pkgs/python-nginx-language-server/default.nix index df3c019..b025a03 100644 --- a/pkgs/python-nginx-language-server/default.nix +++ b/pkgs/python-nginx-language-server/default.nix @@ -2,17 +2,21 @@ lib, python311Packages, fetchFromGitHub, + pkgs, }: let - cusPydantic = python311Packages.pydantic.overridePythonAttrs (oldAttrs: rec { + cusPydantic = python311Packages.buildPythonPackage { + pname = "pydantic"; version = "1.10.18"; - src = fetchFromGitHub { - owner = "pydantic"; - repo = "pydantic"; - rev = "v${version}"; - sha256 = "17v4y4l7bq8716y0vxv817n68k8rlc2sfa86a1jiala04s1jsmr0"; + format = "wheel"; + src = pkgs.fetchurl { + url = "https://files.pythonhosted.org/packages/py3/p/pydantic/pydantic-1.10.18-py3-none-any.whl"; + sha256 = "10iaggdy69wk6qkagqcnlsqchrsidvqhgh68r5p78lpw3yw8k886"; }; doCheck = false; - }); + propagatedBuildInputs = with python311Packages; [ + typing-extensions + ]; + }; in python311Packages.buildPythonPackage rec { pname = "nginx-language-server";