depot/third_party/nixpkgs/pkgs/by-name/st/static-web-server/package.nix
Luke Granger-Brown f92e137cfb
Some checks failed
/ combine-systems (push) Blocked by required conditions
/ build (x86_64-linux) (push) Failing after 11m44s
/ build (aarch64-linux) (push) Failing after 11m50s
/ build (push) Failing after 16m42s
Merge commit '1e2ed035f4bebc9adad02b365508ad96f7df87c1' into HEAD
2025-03-02 02:23:32 +00:00

54 lines
1.3 KiB
Nix

{
lib,
rustPlatform,
fetchFromGitHub,
stdenv,
darwin,
nixosTests,
}:
rustPlatform.buildRustPackage rec {
pname = "static-web-server";
version = "2.36.0";
src = fetchFromGitHub {
owner = "static-web-server";
repo = pname;
rev = "v${version}";
hash = "sha256-TE0V9Ai7lLb1TBtusDV+ACuPO8/1VUjeVZzA4XoL3VQ=";
};
useFetchCargoVendor = true;
cargoHash = "sha256-uGEn+UvHse4tGOAQGzEoFpJxqbXM0u4IrXmMVgKz8z4=";
buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ darwin.apple_sdk.frameworks.Security ];
# Some tests rely on timestamps newer than 18 Nov 1974 00:00:00
preCheck = ''
find docker/public -exec touch -m {} \;
'';
# 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
misilelab
];
mainProgram = "static-web-server";
};
}