From 84ec3af8024a4703f82e5050c9b7c3943d6faea4 Mon Sep 17 00:00:00 2001 From: rowanG077 Date: Thu, 25 Mar 2021 16:10:57 +0100 Subject: [PATCH] powercap: init at 0.3.1 --- pkgs/os-specific/linux/powercap/default.nix | 26 +++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 28 insertions(+) create mode 100644 pkgs/os-specific/linux/powercap/default.nix diff --git a/pkgs/os-specific/linux/powercap/default.nix b/pkgs/os-specific/linux/powercap/default.nix new file mode 100644 index 000000000000..ad9de9f75d5d --- /dev/null +++ b/pkgs/os-specific/linux/powercap/default.nix @@ -0,0 +1,26 @@ +{ lib, stdenv, fetchFromGitHub, cmake }: + +stdenv.mkDerivation rec { + pname = "powercap"; + version = "0.3.1"; + + src = fetchFromGitHub { + owner = "powercap"; + repo = "powercap"; + rev = "v${version}"; + sha256 = "0f1sg1zsskcfralg9khwq7lmz25gvnyknza3bb0hmh1a9lw0jhdn"; + }; + + nativeBuildInputs = [ cmake ]; + + cmakeFlags = [ + "-DBUILD_SHARED_LIBS=On" + ]; + + meta = with lib; { + description = "Tools and library to read/write to the Linux power capping framework (sysfs interface)"; + license = licenses.bsd3; + platforms = platforms.linux; + maintainers = with maintainers; [ rowanG077 ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 8dfaf25fc04e..544a143152a3 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -19429,6 +19429,8 @@ in power-calibrate = callPackage ../os-specific/linux/power-calibrate { }; + powercap = callPackage ../os-specific/linux/powercap { }; + powerstat = callPackage ../os-specific/linux/powerstat { }; smemstat = callPackage ../os-specific/linux/smemstat { };