2022-10-21 18:38:19 +00:00
|
|
|
{ lib
|
|
|
|
, boost
|
|
|
|
, fetchFromGitHub
|
|
|
|
, libsodium
|
2024-01-02 11:29:13 +00:00
|
|
|
, nixVersions
|
2022-10-21 18:38:19 +00:00
|
|
|
, pkg-config
|
|
|
|
, rustPlatform
|
2024-01-02 11:29:13 +00:00
|
|
|
, stdenv
|
2023-05-24 13:37:59 +00:00
|
|
|
, nix-update-script
|
|
|
|
, nixosTests
|
2022-10-21 18:38:19 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "harmonia";
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "0.7.4";
|
2022-10-21 18:38:19 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2023-03-30 22:05:00 +00:00
|
|
|
owner = "nix-community";
|
2022-10-21 18:38:19 +00:00
|
|
|
repo = pname;
|
|
|
|
rev = "refs/tags/${pname}-v${version}";
|
2024-01-02 11:29:13 +00:00
|
|
|
hash = "sha256-72JMrXmxw/FuGjqXXxMIGiAbUUOqXEERdQwch+s3iwU=";
|
2022-10-21 18:38:19 +00:00
|
|
|
};
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
cargoHash = "sha256-Q5Y5v7mmJpfZFGRgurTcRBRtbApFRrwqOBHdZTJbyzc=";
|
2022-10-21 18:38:19 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2024-01-02 11:29:13 +00:00
|
|
|
pkg-config nixVersions.nix_2_19
|
2022-10-21 18:38:19 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
boost
|
|
|
|
libsodium
|
2024-01-02 11:29:13 +00:00
|
|
|
nixVersions.nix_2_19
|
2022-10-21 18:38:19 +00:00
|
|
|
];
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
# Workaround for https://github.com/NixOS/nixpkgs/issues/166205
|
|
|
|
env = lib.optionalAttrs stdenv.cc.isClang {
|
|
|
|
NIX_LDFLAGS = "-l${stdenv.cc.libcxx.cxxabi.libName}";
|
|
|
|
};
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
passthru = {
|
|
|
|
updateScript = nix-update-script {
|
|
|
|
extraArgs = [ "--version-regex" "harmonia-v(.*)" ];
|
|
|
|
};
|
|
|
|
tests = { inherit (nixosTests) harmonia; };
|
|
|
|
};
|
|
|
|
|
2022-10-21 18:38:19 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Nix binary cache";
|
2023-05-24 13:37:59 +00:00
|
|
|
homepage = "https://github.com/nix-community/harmonia";
|
2022-10-21 18:38:19 +00:00
|
|
|
license = licenses.mit;
|
2023-05-24 13:37:59 +00:00
|
|
|
maintainers = with maintainers; [ mic92 ];
|
2023-08-04 22:07:22 +00:00
|
|
|
mainProgram = "harmonia";
|
2022-10-21 18:38:19 +00:00
|
|
|
};
|
|
|
|
}
|