14 rustPlatform.buildRustPackage rec {
18 src = fetchFromGitHub {
22 hash = "sha256-cXwgPYTgom4KrL/PH53Fk6ChtALuMYyJ/oTrUKHCrzE=";
25 cargoHash = "sha256-Vdkq9ShbHWepvIgHPjhKY+LmhjS+Pl84QelgEpen7Qs=";
27 nativeBuildInputs = [ pkg-config ];
28 buildInputs = [ openssl ];
33 # Work around to pass test due to non existing path
34 # https://github.com/hubblo-org/scaphandre/blob/v0.5.0/src/sensors/powercap_rapl.rs#L29
35 export SCAPHANDRE_POWERCAP_PATH="$(mktemp -d)/scaphandre"
37 mkdir -p "$SCAPHANDRE_POWERCAP_PATH"
43 updateScript = nix-update-script { };
45 stdout = self: runCommand "${pname}-test" {
51 ${self}/bin/scaphandre stdout -t 4 > $out || die "Scaphandre failed to measure consumption"
54 vm = nixosTests.scaphandre;
55 version = testers.testVersion {
58 command = "scaphandre --version";
64 description = "Electrical power consumption metrology agent";
65 homepage = "https://github.com/hubblo-org/scaphandre";
66 license = licenses.asl20;
67 platforms = [ "x86_64-linux" ];
68 maintainers = with maintainers; [ gaelreyrol ];
69 mainProgram = "scaphandre";