summaryrefslogtreecommitdiffstats
path: root/pkgs/tools
diff options
context:
space:
mode:
authorAdam Stephens <adam@valkor.net>2023-02-02 11:26:53 -0500
committerAdam Stephens <adam@valkor.net>2023-02-04 18:47:12 -0500
commit83838cf7b75a4738000b349856c5366a83330f47 (patch)
tree3f153f4b843b9aba18241b3c10a7907d1cc3e210 /pkgs/tools
parentb6f3d9cbeadb3b6364d479e848ca91cfd40b08f6 (diff)
s0ix-selftest-tool: init at 2022-11-04
Diffstat (limited to 'pkgs/tools')
-rw-r--r--pkgs/tools/system/s0ix-selftest-tool/default.nix81
1 files changed, 81 insertions, 0 deletions
diff --git a/pkgs/tools/system/s0ix-selftest-tool/default.nix b/pkgs/tools/system/s0ix-selftest-tool/default.nix
new file mode 100644
index 000000000000..193fbb0aef5f
--- /dev/null
+++ b/pkgs/tools/system/s0ix-selftest-tool/default.nix
@@ -0,0 +1,81 @@
+{
+ acpica-tools,
+ bash,
+ bc,
+ coreutils,
+ fetchFromGitHub,
+ gawk,
+ gnugrep,
+ gnused,
+ linuxPackages,
+ lib,
+ pciutils,
+ powertop,
+ resholve,
+ stdenv,
+ util-linux,
+ xorg,
+ xxd,
+}:
+resholve.mkDerivation {
+ pname = "s0ix-selftest-tool";
+ version = "unstable-2022-11-04";
+
+ src = fetchFromGitHub {
+ owner = "intel";
+ repo = "S0ixSelftestTool";
+ rev = "1b6db3c3470a3a74b052cb728a544199661d18ec";
+ hash = "sha256-w97jfdppW8kC8K8XvBntmkfntIctXDQCWmvug+H1hKA=";
+ };
+
+ # don't use the bundled turbostat binary
+ postPatch = ''
+ substituteInPlace s0ix-selftest-tool.sh --replace '"$DIR"/turbostat' 'turbostat'
+ substituteInPlace s0ix-selftest-tool.sh --replace 'sudo ' ""
+
+ '';
+
+ dontConfigure = true;
+ dontBuild = true;
+
+ installPhase = ''
+ runHook preInstall
+ install -Dm555 s0ix-selftest-tool.sh "$out/bin/s0ix-selftest-tool"
+ runHook postInstall
+ '';
+
+ solutions = {
+ default = {
+ scripts = ["bin/s0ix-selftest-tool"];
+ interpreter = lib.getExe bash;
+ inputs = [
+ acpica-tools
+ bc
+ coreutils
+ gawk
+ gnugrep
+ gnused
+ linuxPackages.turbostat
+ pciutils
+ powertop
+ util-linux
+ xorg.xset
+ xxd
+ ];
+ execer = [
+ "cannot:${util-linux}/bin/dmesg"
+ "cannot:${powertop}/bin/powertop"
+ "cannot:${util-linux}/bin/rtcwake"
+ "cannot:${linuxPackages.turbostat}/bin/turbostat"
+ ];
+ };
+ };
+
+ meta = with lib; {
+ homepage = "https://github.com/intel/S0ixSelftestTool";
+ description = "A tool for testing the S2idle path CPU Package C-state and S0ix failures";
+ license = licenses.gpl2Only;
+ platforms = platforms.linux;
+ maintainers = with maintainers; [adamcstephens];
+ };
+}