2024-07-27 06:49:29 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
rustPlatform,
|
|
|
|
fetchFromGitHub,
|
|
|
|
fetchpatch,
|
|
|
|
stdenv,
|
|
|
|
darwin,
|
|
|
|
nixosTests,
|
|
|
|
}:
|
2022-12-28 21:21:41 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "static-web-server";
|
2024-10-04 16:56:33 +00:00
|
|
|
version = "2.33.0";
|
2022-12-28 21:21:41 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "static-web-server";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2024-10-04 16:56:33 +00:00
|
|
|
hash = "sha256-WR8fzpeN6zufvakanJBSMtgTpfDRqCyaTfEzE5NqFOA=";
|
2022-12-28 21:21:41 +00:00
|
|
|
};
|
|
|
|
|
2024-10-04 16:56:33 +00:00
|
|
|
cargoHash = "sha256-AasNva4SOTSrvBTrGHX/jOPjcjt3o8KUsFL7e4uhW6M=";
|
2022-12-28 21:21:41 +00:00
|
|
|
|
2024-09-26 11:04:55 +00:00
|
|
|
buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ darwin.apple_sdk.frameworks.Security ];
|
2024-07-27 06:49:29 +00:00
|
|
|
|
|
|
|
# Some tests rely on timestamps newer than 18 Nov 1974 00:00:00
|
|
|
|
preCheck = ''
|
|
|
|
find docker/public -exec touch -m {} \;
|
|
|
|
'';
|
2022-12-28 21:21:41 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
# 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}
|
|
|
|
'';
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
passthru.tests = {
|
|
|
|
inherit (nixosTests) static-web-server;
|
|
|
|
};
|
2023-07-15 17:15:38 +00:00
|
|
|
|
2022-12-28 21:21:41 +00:00
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Asynchronous web server for static files-serving";
|
2023-04-29 16:46:19 +00:00
|
|
|
homepage = "https://static-web-server.net/";
|
2022-12-28 21:21:41 +00:00
|
|
|
changelog = "https://github.com/static-web-server/static-web-server/blob/v${version}/CHANGELOG.md";
|
2024-07-27 06:49:29 +00:00
|
|
|
license = with licenses; [
|
|
|
|
mit # or
|
|
|
|
asl20
|
|
|
|
];
|
2022-12-28 21:21:41 +00:00
|
|
|
maintainers = with maintainers; [ figsoda ];
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "static-web-server";
|
2022-12-28 21:21:41 +00:00
|
|
|
};
|
|
|
|
}
|