2021-03-09 03:18:52 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
2021-03-20 04:20:00 +00:00
|
|
|
, installShellFiles
|
2020-04-24 23:36:52 +00:00
|
|
|
, pkg-config
|
|
|
|
, zlib
|
2021-03-23 19:22:30 +00:00
|
|
|
, libiconv
|
2020-04-24 23:36:52 +00:00
|
|
|
, Security
|
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "miniserve";
|
2022-03-05 16:20:37 +00:00
|
|
|
version = "0.19.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "svenstaro";
|
|
|
|
repo = "miniserve";
|
|
|
|
rev = "v${version}";
|
2022-03-05 16:20:37 +00:00
|
|
|
sha256 = "sha256-/LmLz4hTmOjpR4Bqf+hABh3PSeaO/sSz/EgHp+nM20o=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-03-05 16:20:37 +00:00
|
|
|
cargoSha256 = "sha256-/KL5c5OeflNDKWuE5Gzqgcew9zf8HFjvmBid+mQSqZE=";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-03-20 04:20:00 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles pkg-config zlib ];
|
2021-03-23 19:22:30 +00:00
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [ libiconv Security ];
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
checkFlags = [
|
|
|
|
"--skip=bind_ipv4_ipv6::case_2"
|
|
|
|
"--skip=cant_navigate_up_the_root"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-03-20 04:20:00 +00:00
|
|
|
postInstall = ''
|
|
|
|
installShellCompletion --cmd miniserve \
|
|
|
|
--bash <($out/bin/miniserve --print-completions bash) \
|
|
|
|
--fish <($out/bin/miniserve --print-completions fish) \
|
|
|
|
--zsh <($out/bin/miniserve --print-completions zsh)
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "For when you really just want to serve some files over HTTP right now!";
|
|
|
|
homepage = "https://github.com/svenstaro/miniserve";
|
|
|
|
license = with licenses; [ mit ];
|
2021-12-30 13:39:12 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.unix;
|
2022-01-03 16:56:52 +00:00
|
|
|
# https://hydra.nixos.org/build/162650896/nixlog/1
|
|
|
|
broken = stdenv.isDarwin && stdenv.isAarch64;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|