Files
nixpkgs/pkgs/by-name/mi/miniserve/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

78 lines
1.8 KiB
Nix

{
lib,
rustPlatform,
fetchFromGitHub,
pkg-config,
installShellFiles,
openssl,
cacert,
stdenv,
curl,
versionCheckHook,
nix-update-script,
}:
rustPlatform.buildRustPackage (finalAttrs: {
pname = "miniserve";
version = "0.32.0";
src = fetchFromGitHub {
owner = "svenstaro";
repo = "miniserve";
tag = "v${finalAttrs.version}";
hash = "sha256-9x2LGJwPf6QEvHvGD8i9Bz3tV8DNAtd9Wp9tXsbI2qo=";
};
cargoHash = "sha256-JVzWmo+28K1kG4QaiAkGgBr8kkdfqoylJBWi+Fo9L6c=";
nativeBuildInputs = [
pkg-config
installShellFiles
];
buildInputs = [ openssl ];
nativeCheckInputs = [
curl
cacert
];
checkFlags = [
"--skip=bind_ipv4_ipv6::case_2"
"--skip=qrcode_hidden_in_tty_when_disabled"
"--skip=qrcode_shown_in_tty_when_enabled"
"--skip=show_root_readme_contents"
"--skip=validate_printed_urls"
];
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
$out/bin/miniserve --print-manpage >miniserve.1
installManPage miniserve.1
installShellCompletion --cmd miniserve \
--bash <($out/bin/miniserve --print-completions bash) \
--fish <($out/bin/miniserve --print-completions fish) \
--zsh <($out/bin/miniserve --print-completions zsh)
'';
__darwinAllowLocalNetworking = true;
nativeInstallCheckInputs = [ versionCheckHook ];
versionCheckProgramArg = "--version";
doInstallCheck = true;
passthru.updateScript = nix-update-script { };
meta = {
description = "CLI tool to serve files and directories over HTTP";
homepage = "https://github.com/svenstaro/miniserve";
changelog = "https://github.com/svenstaro/miniserve/blob/v${finalAttrs.version}/CHANGELOG.md";
license = with lib.licenses; [ mit ];
maintainers = with lib.maintainers; [
figsoda
defelo
];
mainProgram = "miniserve";
};
})