summary refs log tree commit diff
diff options
context:
space:
mode:
authorPaul Schyska <pschyska@gmail.com>2021-05-17 01:26:22 +0200
committerGitHub <noreply@github.com>2021-05-17 01:26:22 +0200
commit3b0bc541316bb581f94c549f8ed2ac132e1b594f (patch)
tree12d3d06ca332b558178fbe230a6941d9467a5de6
parent76554beed86e6935fefee25cdd8c78bf524aac4c (diff)
downloadnixpkgs-3b0bc541316bb581f94c549f8ed2ac132e1b594f.tar
nixpkgs-3b0bc541316bb581f94c549f8ed2ac132e1b594f.tar.gz
nixpkgs-3b0bc541316bb581f94c549f8ed2ac132e1b594f.tar.bz2
nixpkgs-3b0bc541316bb581f94c549f8ed2ac132e1b594f.tar.lz
nixpkgs-3b0bc541316bb581f94c549f8ed2ac132e1b594f.tar.xz
nixpkgs-3b0bc541316bb581f94c549f8ed2ac132e1b594f.tar.zst
nixpkgs-3b0bc541316bb581f94c549f8ed2ac132e1b594f.zip
atop:, nixos/atop: Apply style suggestions
Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
-rw-r--r--pkgs/os-specific/linux/atop/default.nix15
1 files 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; {