1{
2 lib,
3 fetchFromGitHub,
4 nix-update-script,
5 python3Packages,
6}:
7
8python3Packages.buildPythonApplication {
9 pname = "memtree";
10 version = "0-unstable-2025-06-10";
11 pyproject = true;
12
13 src = fetchFromGitHub {
14 owner = "nicoonoclaste";
15 repo = "memtree";
16 rev = "ad1a7d1e4fa5f195c2aa1012101d01ab580a05e8";
17 hash = "sha256-stIRBXhaLqYsN2WMQnu46z39ssantzM8M6T3kCOoZKc=";
18
19 # Remove irrelevant content, avoid src hash change on flake.lock updates etc.
20 postFetch = "rm -r $out/.* $out/flake.* $out/bors.toml";
21 };
22
23 build-system = with python3Packages; [
24 poetry-core
25 ];
26
27 dependencies = with python3Packages; [
28 rich
29 ];
30
31 nativeCheckInputs = with python3Packages; [
32 hypothesis
33 pytestCheckHook
34 ];
35
36 pytestFlags = [ "-v" ];
37 pythonImportsCheck = [ "memtree" ];
38
39 passthru.updateScript = nix-update-script {
40 extraArgs = [ "--version=branch" ];
41 };
42
43 meta = with lib; {
44 description = "Render cgroups tree annotated by memory usage";
45 homepage = "https://github.com/nbraud/memtree";
46 maintainers = with maintainers; [ nicoo ];
47 mainProgram = "memtree";
48 platforms = platforms.linux;
49 };
50}