2022-06-09 16:46:51 +01:00
|
|
|
{ pkgs, lib, ... }:
|
|
|
|
{
|
|
|
|
name = "agate";
|
|
|
|
meta = with lib.maintainers; { maintainers = [ jk ]; };
|
2022-02-07 16:03:58 +00:00
|
|
|
|
2022-06-09 16:46:51 +01:00
|
|
|
nodes = {
|
|
|
|
geminiserver = { pkgs, ... }: {
|
|
|
|
services.agate = {
|
|
|
|
enable = true;
|
|
|
|
hostnames = [ "localhost" ];
|
|
|
|
contentDir = pkgs.writeTextDir "index.gmi" ''
|
|
|
|
# Hello NixOS!
|
|
|
|
'';
|
2022-02-07 16:03:58 +00:00
|
|
|
};
|
|
|
|
};
|
2022-06-09 16:46:51 +01:00
|
|
|
};
|
2022-02-07 16:03:58 +00:00
|
|
|
|
2022-06-09 16:46:51 +01:00
|
|
|
testScript = { nodes, ... }: ''
|
|
|
|
geminiserver.wait_for_unit("agate")
|
|
|
|
geminiserver.wait_for_open_port(1965)
|
2022-02-07 16:03:58 +00:00
|
|
|
|
2022-06-09 16:46:51 +01:00
|
|
|
with subtest("check is serving over gemini"):
|
2023-08-15 22:26:54 +01:00
|
|
|
response = geminiserver.succeed("${pkgs.gemget}/bin/gemget --header -o - gemini://localhost:1965")
|
2022-06-09 16:46:51 +01:00
|
|
|
print(response)
|
|
|
|
assert "Hello NixOS!" in response
|
|
|
|
'';
|
|
|
|
}
|