1{
2 lib,
3 fetchFromGitHub,
4 rustPlatform,
5
6 pkg-config,
7 openssl,
8
9 versionCheckHook,
10
11 nix-update-script,
12 nixosTests,
13}:
14
15rustPlatform.buildRustPackage (finalAttrs: {
16 pname = "agate";
17 version = "3.3.17";
18
19 __darwinAllowLocalNetworking = true;
20
21 src = fetchFromGitHub {
22 owner = "mbrubeck";
23 repo = "agate";
24 tag = "v${finalAttrs.version}";
25 hash = "sha256-zT56JGP2SfOqLL/sLxo3PHnbAvLI+lifmCvLdPwzCZM=";
26 };
27
28 cargoHash = "sha256-vemmO7xYf83rBNEvJKaq5CjobG1LUxt7M5zeQegTUmM=";
29
30 nativeBuildInputs = [ pkg-config ];
31 buildInputs = [ openssl ];
32
33 nativeInstallCheckInputs = [ versionCheckHook ];
34
35 doInstallCheck = true;
36
37 passthru = {
38 tests = {
39 inherit (nixosTests) agate;
40 };
41 updateScript = nix-update-script { };
42 };
43
44 meta = {
45 homepage = "https://github.com/mbrubeck/agate";
46 changelog = "https://github.com/mbrubeck/agate/releases/tag/v${finalAttrs.version}";
47 description = "Very simple server for the Gemini hypertext protocol";
48 mainProgram = "agate";
49 longDescription = ''
50 Agate is a server for the Gemini network protocol, built with the Rust
51 programming language. Agate has very few features, and can only serve
52 static files. It uses async I/O, and should be quite efficient even when
53 running on low-end hardware and serving many concurrent requests.
54 '';
55 license = with lib.licenses; [
56 asl20
57 # or
58 mit
59 ];
60 maintainers = with lib.maintainers; [ jk ];
61 };
62})