From 9f2e496f4fb41bc1eaaae06395a1ebefc098119f Mon Sep 17 00:00:00 2001 From: Kristian Krsnik Date: Mon, 5 Aug 2024 00:09:41 +0200 Subject: [PATCH] add setuptools to build fasthtml from source --- flake.nix | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 44c768c..9cdce48 100644 --- a/flake.nix +++ b/flake.nix @@ -18,6 +18,15 @@ forAllSystems = inputs.nixpkgs.lib.genAttrs supportedSystems; pkgs = forAllSystems (system: inputs.nixpkgs.legacyPackages.${system}); poetry2nix = forAllSystems (system: inputs.poetry2nix-lib.lib.mkPoetry2Nix {pkgs = pkgs.${system};}); + + addSetuptools = self: super: list: + builtins.listToAttrs (builtins.map (package: { + name = "${package}"; + value = super."${package}".overridePythonAttrs (old: { + nativeBuildInputs = (old.nativeBuildInputs or []) ++ [self.setuptools]; + }); + }) + list); in { # `nix build` packages = forAllSystems (system: let @@ -29,8 +38,11 @@ then "pyright && pytest" else ""; # doCheck = debug; - preferWheels = true; + preferWheels = false; nativeBuildInputs = with pkgs.${system}; [pyright]; + overrides = + poetry2nix.${system}.overrides.withDefaults (self: super: + addSetuptools self super ["sqlite-minutils" "fastlite" "python-fasthtml"]); }; in { default = mkPackage {debug = false;};