I want to install python package (GitHub - crabvk/bar-gmail: A Polybar module to show unread messages from Gmail) on system level. I’ve got working results for non-poetry packages but struggling with poetry ones.
Current state of my module:
{ inputs, config, lib, pkgs, ... }:
let
# Create an overriden python that has our custom package
python312 = pkgs.python312.override {
self = python312;
packageOverrides = self: super: {
bar-gmail = self.buildPythonPackage rec {
pname = "bar-gmail";
format = "pyproject";
version = "1.0.5";
src = pkgs.fetchFromGitHub {
owner = "crabvk";
repo = "bar-gmail";
rev = "ca33c40240fbf563c723ff19b3e0feae42f6160a";
sha256 = "0rs9bxxrw4wscf4a8yl776a8g880m5gcm75q06yx2cn3lw2b7v22";
};
doCheck = false;
nativeBuildInputs = [ self.poetry-core ];
buildInputs = [
self.google-api-python-client
self.google-auth-httplib2
self.google-auth-oauthlib
self.dasbus
self.pygobject3
self.poetry-core
];
};
};
};
in
{
options = {
nyx.work.enable =
lib.mkEnableOption "enables work related packages";
};
config = lib.mkIf config.nyx.work.enable {
environment.systemPackages = with pkgs; [
poetry
(python312.withPackages (ps: with ps; [
numpy
scipy
pip
ps.bar-gmail
# working example
# (python39.pkgs.buildPythonPackage rec {
# pname = "findiff";
# version = "0.9.2";
# src = fetchPypi {
# inherit pname version;
# sha256 = "sha256-IWqQhGv+8d3mYdnwJh1byj0su2c0K5fpMTylsvR4c2U=";
# };
# doCheck = false;
# buildInputs = [
# numpy
# scipy
# sympy
# ];
# })
];
};
}
Error i get:
error: builder for '/nix/store/4nvb31h32qym2rsa8nc7smwdikf2ayjf-python3.12-bar-gmail-1.0.5.drv' failed with exit code 1;
last 10 log lines:
> source root is source
> setting SOURCE_DATE_EPOCH to timestamp 315619200 of file source/src/windows/versioninfo.rc
> Running phase: patchPhase
> Running phase: updateAutotoolsGnuConfigScriptsPhase
> Running phase: configurePhase
> no configure script, doing nothing
> Running phase: buildPhase
> Executing pypaBuildPhase
> Creating a wheel...
> ERROR Source /build/source does not appear to be a Python project: no pyproject.toml or setup.py
For full logs, run 'nix log /nix/store/4nvb31h32qym2rsa8nc7smwdikf2ayjf-python3.12-bar-gmail-1.0.5.drv'.
error: 1 dependencies of derivation '/nix/store/x2p50b953zldiivnk8xhwzq6ih4raj4k-python3-3.12.3-env.drv' failed to build
error (ignored): error: cannot unlink '/tmp/nix-build-python3.12-3.12.3-doc.drv-4/Python-3.12.3/Lib': Directory not empty
error: 1 dependencies of derivation '/nix/store/fpql2aj2q6klmlpgy5l3dwnfsskz93sv-system-path.drv' failed to build
error: 1 dependencies of derivation '/nix/store/ix4gizd7n0r7qwnp7s0v3rnkp3jxvdgq-nixos-system-sphHpNixos-24.11.20240612.57d6973.drv' failed to build
it says that pyproject.toml not found, but project clearly have it: