12 # makes the package unfree via pynvml
16 stdenv.mkDerivation rec {
21 url = "https://www.atoptool.nl/download/atop-${version}.tar.gz";
22 hash = "sha256-m5TGZmAu//e/QC7M5wbDR/OMOctjSY+dOWJoYeVkbiA=";
25 nativeBuildInputs = lib.optionals withAtopgpu [
26 python3.pkgs.wrapPython
34 ] ++ lib.optionals withAtopgpu [
38 pythonPath = lib.optionals withAtopgpu [
46 "MAN1PATH=/share/man/man1"
47 "MAN5PATH=/share/man/man5"
48 "MAN8PATH=/share/man/man8"
49 "SYSDPATH=/lib/systemd/system"
50 "PMPATHD=/lib/systemd/system-sleep"
54 # Fix paths in atop.service, atop-rotate.service, atopgpu.service, atopacct.service,
57 # Don't fail on missing /etc/default/atop, make sure /var/log/atop exists pre-start
62 for f in *.{sh,service}; do
63 findutils=${findutils} systemd=${systemd} substituteAllInPlace "$f"
66 substituteInPlace Makefile --replace 'chown' 'true'
67 substituteInPlace Makefile --replace 'chmod 04711' 'chmod 0711'
75 # Remove extra files we don't need
76 rm -r $out/{var,etc} $out/bin/atop{sar,}-${version}
77 '' + (if withAtopgpu then ''
80 rm $out/lib/systemd/system/atopgpu.service $out/bin/atopgpud $out/share/man/man8/atopgpud.8
83 passthru.tests = { inherit (nixosTests) atop; };
86 platforms = platforms.linux;
87 maintainers = with maintainers; [ raskin ];
88 description = "Console system performance monitor";
90 Atop is an ASCII full-screen performance monitor that is capable of reporting the activity of
91 all processes (even if processes have finished during the interval), daily logging of system
92 and process activity for long-term analysis, highlighting overloaded system resources by using
93 colors, etc. At regular intervals, it shows system-level activity related to the CPU, memory,
94 swap, disks and network layers, and for every active process it shows the CPU utilization,
95 memory growth, disk utilization, priority, username, state, and exit code.
97 license = licenses.gpl2Plus;
98 downloadPage = "http://atoptool.nl/downloadatop.php";