2023-08-04 22:07:22 +00:00
|
|
|
{ lib, fetchFromGitHub, nix, ronn, rustPlatform }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-05-29 06:06:01 +00:00
|
|
|
let
|
2020-04-24 23:36:52 +00:00
|
|
|
blake3-src = fetchFromGitHub {
|
|
|
|
owner = "BLAKE3-team";
|
|
|
|
repo = "BLAKE3";
|
2020-05-29 06:06:01 +00:00
|
|
|
rev = "0.3.3";
|
|
|
|
sha256 = "0av41ld0gqf3g60gcllpz59nqlr7r62v99mgfq9gs0p8diw5gi7x";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
in rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "cached-nix-shell";
|
2021-12-06 16:07:01 +00:00
|
|
|
version = "0.1.5";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "xzfc";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2021-12-06 16:07:01 +00:00
|
|
|
sha256 = "17v38llx83mp05a0axjxcd2zyafd57syh7xhx5cq6qibcbha0by9";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
cargoSha256 = "1jkkwsn3k2anmzf99x99r9zfnf0gpcjbi5pyakh4agiryqcdyg0j";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# The BLAKE3 C library is intended to be built by the project depending on it
|
|
|
|
# rather than as a standalone library.
|
|
|
|
# https://github.com/BLAKE3-team/BLAKE3/blob/0.3.1/c/README.md#building
|
|
|
|
BLAKE3_CSRC = "${blake3-src}/c";
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
nativeBuildInputs = [ nix ronn ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
postBuild = ''
|
2020-11-30 08:33:03 +00:00
|
|
|
make -f nix/Makefile post-build
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
2020-11-30 08:33:03 +00:00
|
|
|
make -f nix/Makefile post-install
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Instant startup time for nix-shell";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "cached-nix-shell";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/xzfc/cached-nix-shell";
|
|
|
|
license = with licenses; [ unlicense /* or */ mit ];
|
|
|
|
maintainers = with maintainers; [ xzfc ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|