atop:, nixos/atop: Apply style suggestions

Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
This commit is contained in:
Paul Schyska 2021-05-17 01:26:22 +02:00 committed by GitHub
parent 76554beed8
commit 3b0bc54131
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6,7 +6,7 @@
, findutils , findutils
, systemd , systemd
, python3 , python3
# makes the package unfree via pynvml # makes the package unfree via pynvml
, withAtopgpu ? false , withAtopgpu ? false
}: }:
@ -19,9 +19,9 @@ stdenv.mkDerivation rec {
sha256 = "nsLKOlcWkvfvqglfmaUQZDK8txzCLNbElZfvBIEFj3I="; sha256 = "nsLKOlcWkvfvqglfmaUQZDK8txzCLNbElZfvBIEFj3I=";
}; };
nativeBuildInputs = if withAtopgpu then [ python3.pkgs.wrapPython ] else [ ]; nativeBuildInputs = lib.optionals withAtopgpu [ python3.pkgs.wrapPython ];
buildInputs = [ zlib ncurses ] ++ (if withAtopgpu then [ python3 ] else [ ]); buildInputs = [ zlib ncurses ] ++ lib.optionals withAtopgpu [ python3 ];
pythonPath = if withAtopgpu then [ python3.pkgs.pynvml ] else [ ]; pythonPath = lib.optionals withAtopgpu [ python3.pkgs.pynvml ];
makeFlags = [ makeFlags = [
"DESTDIR=$(out)" "DESTDIR=$(out)"
@ -59,14 +59,11 @@ stdenv.mkDerivation rec {
''; '';
postInstall = '' postInstall = ''
# remove extra files we don't need # remove extra files we don't need
rm -rf $out/{var,etc} rm -r $out/{var,etc} $out/bin/atop{sar,}-${version}
rm -rf $out/bin/atop{sar,}-${version}
'' + (if withAtopgpu then '' '' + (if withAtopgpu then ''
wrapPythonPrograms wrapPythonPrograms
'' else '' '' else ''
rm $out/lib/systemd/system/atopgpu.service rm $out/lib/systemd/system/atopgpu.service $out/bin/atopgpud $out/share/man/man8/atopgpud.8
rm $out/bin/atopgpud
rm $out/share/man/man8/atopgpud.8
''); '');
meta = with lib; { meta = with lib; {