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";
|
2021-04-19 03:05:28 +00:00
|
|
|
version = "0.14.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "svenstaro";
|
|
|
|
repo = "miniserve";
|
|
|
|
rev = "v${version}";
|
2021-04-19 03:05:28 +00:00
|
|
|
sha256 = "sha256-Hv1aefuiu7pOlSMUjZLGY6bxVy+6myFH1afZZ5gtmi0=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-04-19 03:05:28 +00:00
|
|
|
cargoSha256 = "sha256-CgiHluc9+5+hKwsC7UZimy1586QBUsj+TVlb2lQRXs0=";
|
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 ];
|
|
|
|
|
|
|
|
checkFlags = [ "--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 ];
|
2020-10-11 12:50:04 +00:00
|
|
|
maintainers = with maintainers; [ zowoq ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|