@@ -6,7 +6,7 @@
66, findutils
77, systemd
88, python3
9− # makes the package unfree via pynvml
9+# makes the package unfree via pynvml
1010, withAtopgpu ? false
1111}:
1212
@@ -19,9 +19,9 @@ stdenv.mkDerivation rec {
1919 sha256 = "nsLKOlcWkvfvqglfmaUQZDK8txzCLNbElZfvBIEFj3I=";
2020 };
2121
22− nativeBuildInputs = if withAtopgpu then [ python3.pkgs.wrapPython ] else [ ];
23− buildInputs = [ zlib ncurses ] ++ (if withAtopgpu then [ python3 ] else [ ]);
24− pythonPath = if withAtopgpu then [ python3.pkgs.pynvml ] else [ ];
22+ nativeBuildInputs = lib.optionals withAtopgpu [ python3.pkgs.wrapPython ];
23+ buildInputs = [ zlib ncurses ] ++ lib.optionals withAtopgpu [ python3 ];
24+ pythonPath = lib.optionals withAtopgpu [ python3.pkgs.pynvml ];
2525
2626 makeFlags = [
2727 "DESTDIR=$(out)"
@@ -59,14 +59,11 @@ stdenv.mkDerivation rec {
5959 '';
6060 postInstall = ''
6161 # remove extra files we don't need
62− rm -rf $out/{var,etc}
63− rm -rf $out/bin/atop{sar,}-${version}
62+ rm -r $out/{var,etc} $out/bin/atop{sar,}-${version}
6463 '' + (if withAtopgpu then ''
6564 wrapPythonPrograms
6665 '' else ''
67− rm $out/lib/systemd/system/atopgpu.service
68− rm $out/bin/atopgpud
69− rm $out/share/man/man8/atopgpud.8
66+ rm $out/lib/systemd/system/atopgpu.service $out/bin/atopgpud $out/share/man/man8/atopgpud.8
7067 '');
7168
7269 meta = with lib; {