1{ 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 setuptools, 6}: 7 8buildPythonPackage rec { 9 pname = "cgroup-utils"; 10 version = "0.8"; 11 pyproject = true; 12 13 src = fetchFromGitHub { 14 owner = "peo3"; 15 repo = "cgroup-utils"; 16 rev = "v${version}"; 17 sha256 = "0qnbn8cnq8m14s8s1hcv25xjd55dyb6yy54l5vc7sby5xzzp11fq"; 18 }; 19 20 postPatch = '' 21 sed -i -e "/argparse/d" setup.py 22 ''; 23 24 build-system = [ setuptools ]; 25 26 # Upon running `from cgutils import cgroup`, it attempts to read a file in `/sys`. 27 # Due to the Nix build sandbox, this is disallowed, and so all possible tests fail, 28 # so we don't run them. Plain `import cgutils` works, so we run pythonImportsCheck below. 29 doCheck = false; 30 31 pythonImportsCheck = [ "cgutils" ]; 32 33 meta = { 34 description = "Utility tools for control groups of Linux"; 35 homepage = "https://github.com/peo3/cgroup-utils"; 36 mainProgram = "cgutil"; 37 maintainers = with lib.maintainers; [ layus ]; 38 platforms = lib.platforms.linux; 39 license = lib.licenses.gpl2Plus; 40 }; 41}