nixpkgs/pkgs/servers/static-web-server/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

43 lines
1.3 KiB
Nix
Raw Normal View History

{ lib, rustPlatform, fetchFromGitHub, stdenv, darwin, nixosTests }:
2022-12-18 05:18:56 +01:00
rustPlatform.buildRustPackage rec {
pname = "static-web-server";
2023-12-29 11:13:57 +01:00
version = "2.24.2";
2022-12-18 05:18:56 +01:00
src = fetchFromGitHub {
owner = "static-web-server";
repo = pname;
rev = "v${version}";
2023-12-29 11:13:57 +01:00
hash = "sha256-5Axqn3sYLM4yjGkN8d0ZUe8KrjYszaZmTg5GqmamNtc=";
2022-12-18 05:18:56 +01:00
};
2023-12-29 11:13:57 +01:00
cargoHash = "sha256-xS2XARqXXcQ2J1k3jC5St19RdcK2korbEia4koUxG5s=";
2022-12-18 05:18:56 +01:00
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; };
2022-12-18 05:18:56 +01:00
meta = with lib; {
2023-07-04 18:24:16 +02:00
description = "An asynchronous web server for static files-serving";
homepage = "https://static-web-server.net/";
2022-12-18 05:18:56 +01:00
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 ];
2023-11-23 22:09:35 +01:00
mainProgram = "static-web-server";
2022-12-18 05:18:56 +01:00
};
}