nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 rustPlatform,
4 fetchFromGitHub,
5 nixosTests,
6}:
7
8rustPlatform.buildRustPackage rec {
9 pname = "static-web-server";
10 version = "2.39.0";
11
12 src = fetchFromGitHub {
13 owner = "static-web-server";
14 repo = "static-web-server";
15 rev = "v${version}";
16 hash = "sha256-iprQlSHO+ac7v1odVoS/9IU+Zov8/xh1l9pm1PJE8fs=";
17 };
18
19 cargoHash = "sha256-rNrGlgUvPezX7RnKhprRjl9DiJ/Crt4phmxnfY9tNXA=";
20
21 # Some tests rely on timestamps newer than 18 Nov 1974 00:00:00
22 preCheck = ''
23 find docker/public -exec touch -m {} \;
24 '';
25
26 # Need to copy in the systemd units for systemd.packages to discover them
27 postInstall = ''
28 install -Dm444 -t $out/lib/systemd/system/ systemd/static-web-server.{service,socket}
29 '';
30
31 passthru.tests = {
32 inherit (nixosTests) static-web-server;
33 };
34
35 meta = {
36 description = "Asynchronous web server for static files-serving";
37 homepage = "https://static-web-server.net/";
38 changelog = "https://github.com/static-web-server/static-web-server/blob/v${version}/CHANGELOG.md";
39 license = with lib.licenses; [
40 mit # or
41 asl20
42 ];
43 maintainers = with lib.maintainers; [
44 misilelab
45 ];
46 mainProgram = "static-web-server";
47 };
48}