lol
at 23.11-beta 41 lines 1.3 kB view raw
1{ lib, rustPlatform, fetchFromGitHub, stdenv, darwin, nixosTests }: 2 3rustPlatform.buildRustPackage rec { 4 pname = "static-web-server"; 5 version = "2.24.1"; 6 7 src = fetchFromGitHub { 8 owner = "static-web-server"; 9 repo = pname; 10 rev = "v${version}"; 11 hash = "sha256-U+B/k/stwjJw+mxUCb4A3yUtc/+Tg0PsWhVnovLLX4A="; 12 }; 13 14 cargoHash = "sha256-ZDrRjIM8187nr72MlzFr0NAqH2f8qkF1sGAT9+NvfhA="; 15 16 buildInputs = lib.optionals stdenv.isDarwin [ 17 darwin.apple_sdk.frameworks.Security 18 ]; 19 20 checkFlags = [ 21 # TODO: investigate why these tests fail 22 "--skip=tests::handle_byte_ranges_if_range_too_old" 23 "--skip=tests::handle_not_modified" 24 "--skip=handle_precondition" 25 ]; 26 27 # Need to copy in the systemd units for systemd.packages to discover them 28 postInstall = '' 29 install -Dm444 -t $out/lib/systemd/system/ systemd/static-web-server.{service,socket} 30 ''; 31 32 passthru.tests = { inherit (nixosTests) static-web-server; }; 33 34 meta = with lib; { 35 description = "An asynchronous web server for static files-serving"; 36 homepage = "https://static-web-server.net/"; 37 changelog = "https://github.com/static-web-server/static-web-server/blob/v${version}/CHANGELOG.md"; 38 license = with licenses; [ mit /* or */ asl20 ]; 39 maintainers = with maintainers; [ figsoda ]; 40 }; 41}