haccfiles/pkgs/fb_exporter/default.nix

33 lines
812 B
Nix

{
pkgs ? import <nixpkgs> {}
}:
with pkgs;
stdenv.mkDerivation {
pname = "fb_exporter";
version = "0.1.0";
src = fetchgit {
url = "https://cgit.ctu.cx/fritzbox-exporter";
rev = "fc7cb10f4673107c050b6d342e55b8838fe3a424";
sha256 = "168r93l5sqvn6wp7jdyw1g9jz613iwd11pg4zrsnlmr6n466hqh8";
};
nativeBuildInputs = [ nim ];
buildInputs = [ pcre openssl ];
buildPhase = ''
runHook preBuild
nim c -d:release --nimcache:$PWD src/fb_exporter.nim
runHook postBuild
'';
installPhase = ''
runHook preInstall
install -Dm755 src/fb_exporter $out/bin/fb_exporter
runHook postInstall
'';
fixupPhase = ''
runHook preFixup
patchelf --set-rpath ${lib.makeLibraryPath [ pcre openssl ]} $out/bin/fb_exporter
runHook postFixup
'';
}