From ca26131c22bb2833c81254dbabab6d785b9f37f0 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Sat, 7 Jun 2025 14:39:34 +0200 Subject: [PATCH] flake.nix: overlay package into pythonPackages --- default.nix | 15 +++++++++++---- flake.nix | 10 ++++++---- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/default.nix b/default.nix index 92e882b..383fddb 100644 --- a/default.nix +++ b/default.nix @@ -1,18 +1,25 @@ { lib -, python3Packages +, buildPythonPackage + +, setuptools +, setuptools-scm + +, sqlalchemy }: -python3Packages.buildPythonApplication { + +buildPythonPackage { pname = "libdib"; version = "unstable"; src = lib.cleanSource ./.; format = "pyproject"; - nativeBuildInputs = with python3Packages; [ + nativeBuildInputs = [ setuptools setuptools-scm ]; - propagatedBuildInputs = with python3Packages; [ + + propagatedBuildInputs = [ sqlalchemy ]; } diff --git a/flake.nix b/flake.nix index fe58438..0b789ee 100644 --- a/flake.nix +++ b/flake.nix @@ -19,15 +19,17 @@ in { packages = forAllSystems (system: pkgs: { default = self.packages.${system}.libdib; - libdib = pkgs.callPackage ./default.nix { - python3Packages = pkgs.python313Packages; - }; + libdib = pkgs.python3Packages.callPackage ./default.nix { }; }); overlays = { default = self.overlays.libdib; libdib = final: prev: { - inherit (self.packages.${prev.system}) libdib; + pythonPackagesExtensions = prev.pythonPackagesExtensions ++ [ + (python-final: python-prev: { + libdib = python-final.callPackage ./default.nix { }; + }) + ]; }; };