15 rustPlatform.buildRustPackage rec {
19 src = fetchFromGitHub {
23 hash = "sha256-cXwgPYTgom4KrL/PH53Fk6ChtALuMYyJ/oTrUKHCrzE=";
26 cargoHash = "sha256-Vdkq9ShbHWepvIgHPjhKY+LmhjS+Pl84QelgEpen7Qs=";
28 nativeBuildInputs = [ pkg-config ];
29 buildInputs = [ openssl ];
34 # Work around to pass test due to non existing path
35 # https://github.com/hubblo-org/scaphandre/blob/v0.5.0/src/sensors/powercap_rapl.rs#L29
36 export SCAPHANDRE_POWERCAP_PATH="$(mktemp -d)/scaphandre"
38 mkdir -p "$SCAPHANDRE_POWERCAP_PATH"
44 updateScript = nix-update-script { };
48 runCommand "${pname}-test"
56 ${self}/bin/scaphandre stdout -t 4 > $out || die "Scaphandre failed to measure consumption"
59 vm = nixosTests.scaphandre;
60 version = testers.testVersion {
63 command = "scaphandre --version";
69 description = "Electrical power consumption metrology agent";
70 homepage = "https://github.com/hubblo-org/scaphandre";
71 license = licenses.asl20;
72 platforms = [ "x86_64-linux" ];
73 maintainers = with maintainers; [ gaelreyrol ];
74 mainProgram = "scaphandre";