depot/third_party/nixpkgs/pkgs/servers/static-web-server/default.nix
Default email bcb2f287e1 Project import generated by Copybara.
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
2024-06-20 20:27:18 +05:30

42 lines
1.3 KiB
Nix

{ lib, rustPlatform, fetchFromGitHub, stdenv, darwin, nixosTests }:
rustPlatform.buildRustPackage rec {
pname = "static-web-server";
version = "2.24.2";
src = fetchFromGitHub {
owner = "static-web-server";
repo = pname;
rev = "v${version}";
hash = "sha256-5Axqn3sYLM4yjGkN8d0ZUe8KrjYszaZmTg5GqmamNtc=";
};
cargoHash = "sha256-xS2XARqXXcQ2J1k3jC5St19RdcK2korbEia4koUxG5s=";
buildInputs = lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.Security
];
checkFlags = [
# TODO: investigate why these tests fail
"--skip=tests::handle_byte_ranges_if_range_too_old"
"--skip=tests::handle_not_modified"
"--skip=handle_precondition"
];
# Need to copy in the systemd units for systemd.packages to discover them
postInstall = ''
install -Dm444 -t $out/lib/systemd/system/ systemd/static-web-server.{service,socket}
'';
passthru.tests = { inherit (nixosTests) static-web-server; };
meta = with lib; {
description = "Asynchronous web server for static files-serving";
homepage = "https://static-web-server.net/";
changelog = "https://github.com/static-web-server/static-web-server/blob/v${version}/CHANGELOG.md";
license = with licenses; [ mit /* or */ asl20 ];
maintainers = with maintainers; [ figsoda ];
mainProgram = "static-web-server";
};
}