From 3b0bc541316bb581f94c549f8ed2ac132e1b594f Mon Sep 17 00:00:00 2001 From: Paul Schyska Date: Mon, 17 May 2021 01:26:22 +0200 Subject: [PATCH] atop:, nixos/atop: Apply style suggestions Co-authored-by: Sandro --- pkgs/os-specific/linux/atop/default.nix | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/pkgs/os-specific/linux/atop/default.nix b/pkgs/os-specific/linux/atop/default.nix index 61a76a50586..84a5870833a 100644 --- a/pkgs/os-specific/linux/atop/default.nix +++ b/pkgs/os-specific/linux/atop/default.nix @@ -6,7 +6,7 @@ , findutils , systemd , python3 - # makes the package unfree via pynvml +# makes the package unfree via pynvml , withAtopgpu ? false }: @@ -19,9 +19,9 @@ stdenv.mkDerivation rec { sha256 = "nsLKOlcWkvfvqglfmaUQZDK8txzCLNbElZfvBIEFj3I="; }; - nativeBuildInputs = if withAtopgpu then [ python3.pkgs.wrapPython ] else [ ]; - buildInputs = [ zlib ncurses ] ++ (if withAtopgpu then [ python3 ] else [ ]); - pythonPath = if withAtopgpu then [ python3.pkgs.pynvml ] else [ ]; + nativeBuildInputs = lib.optionals withAtopgpu [ python3.pkgs.wrapPython ]; + buildInputs = [ zlib ncurses ] ++ lib.optionals withAtopgpu [ python3 ]; + pythonPath = lib.optionals withAtopgpu [ python3.pkgs.pynvml ]; makeFlags = [ "DESTDIR=$(out)" @@ -59,14 +59,11 @@ stdenv.mkDerivation rec { ''; postInstall = '' # remove extra files we don't need - rm -rf $out/{var,etc} - rm -rf $out/bin/atop{sar,}-${version} + rm -r $out/{var,etc} $out/bin/atop{sar,}-${version} '' + (if withAtopgpu then '' wrapPythonPrograms '' else '' - rm $out/lib/systemd/system/atopgpu.service - rm $out/bin/atopgpud - rm $out/share/man/man8/atopgpud.8 + rm $out/lib/systemd/system/atopgpu.service $out/bin/atopgpud $out/share/man/man8/atopgpud.8 ''); meta = with lib; {