about summary refs log tree commit diff
path: root/pkgs/tools/misc/tlp/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/tools/misc/tlp/default.nix')
-rw-r--r--pkgs/tools/misc/tlp/default.nix48
1 files changed, 30 insertions, 18 deletions
diff --git a/pkgs/tools/misc/tlp/default.nix b/pkgs/tools/misc/tlp/default.nix
index 39d3ea1c2086..2cdb8aff472e 100644
--- a/pkgs/tools/misc/tlp/default.nix
+++ b/pkgs/tools/misc/tlp/default.nix
@@ -1,6 +1,7 @@
 { stdenv, lib, fetchFromGitHub, perl, makeWrapper, file, systemd, iw, rfkill
 , hdparm, ethtool, inetutils , kmod, pciutils, smartmontools
 , x86_energy_perf_policy, gawk, gnugrep, coreutils, utillinux
+, checkbashisms, shellcheck
 , enableRDW ? false, networkmanager
 }:
 
@@ -14,28 +15,31 @@ let
 
 in stdenv.mkDerivation rec {
   name = "tlp-${version}";
-  version = "1.1";
+  version = "1.2.1";
 
   src = fetchFromGitHub {
-        owner = "linrunner";
-        repo = "TLP";
-        rev = "${version}";
-        sha256 = "01bhb9hdsck1g2s5jvafr3ywml9k2qz7x2cf42a3z8g5d23pdfpy";
-      };
+    owner = "linrunner";
+    repo = "TLP";
+    rev = version;
+    sha256 = "1msldl6y8fpvxa9p87lv3hvgxwk2vpiahqmapq485ihdjkshc558";
+  };
+
+  outRef = placeholder "out";
 
-  makeFlags = [ "DESTDIR=$(out)"
-                "TLP_SBIN=$(out)/bin"
-                "TLP_BIN=$(out)/bin"
-                "TLP_TLIB=$(out)/share/tlp-pm"
-                "TLP_PLIB=$(out)/lib/pm-utils"
-                "TLP_ULIB=$(out)/lib/udev"
-                "TLP_NMDSP=$(out)/etc/NetworkManager/dispatcher.d"
-                "TLP_SHCPL=$(out)/share/bash-completion/completions"
-                "TLP_MAN=$(out)/share/man"
+  makeFlags = [
+    "DESTDIR=${outRef}"
+    "TLP_SBIN=${outRef}/bin"
+    "TLP_BIN=${outRef}/bin"
+    "TLP_TLIB=${outRef}/share/tlp"
+    "TLP_FLIB=${outRef}/share/tlp/func.d"
+    "TLP_ULIB=${outRef}/lib/udev"
+    "TLP_NMDSP=${outRef}/etc/NetworkManager/dispatcher.d"
+    "TLP_SHCPL=${outRef}/share/bash-completion/completions"
+    "TLP_MAN=${outRef}/share/man"
+    "TLP_META=${outRef}/share/metainfo"
 
-                "TLP_NO_INIT=1"
-                "TLP_NO_PMUTILS=1"
-              ];
+    "TLP_NO_INIT=1"
+  ];
 
   nativeBuildInputs = [ makeWrapper file ];
 
@@ -43,6 +47,14 @@ in stdenv.mkDerivation rec {
 
   installTargets = [ "install-tlp" "install-man" ] ++ stdenv.lib.optional enableRDW "install-rdw";
 
+  checkInputs = [
+    checkbashisms
+    shellcheck
+  ];
+
+  doCheck = true;
+  checkTarget = [ "checkall" ];
+
   postInstall = ''
     cp -r $out/$out/* $out
     rm -rf $out/$(echo "$NIX_STORE" | cut -d "/" -f2)