2023-04-16 23:24:06 +00:00
|
|
|
{ pkgs, lib, ... }:
|
|
|
|
{
|
|
|
|
name = "stargazer";
|
|
|
|
meta = with lib.maintainers; { maintainers = [ gaykitty ]; };
|
|
|
|
|
|
|
|
nodes = {
|
|
|
|
geminiserver = { pkgs, ... }: {
|
|
|
|
services.stargazer = {
|
|
|
|
enable = true;
|
2023-04-30 00:54:24 +00:00
|
|
|
routes = [
|
|
|
|
{
|
|
|
|
route = "localhost";
|
2023-04-16 23:24:06 +00:00
|
|
|
root = toString (pkgs.writeTextDir "index.gmi" ''
|
|
|
|
# Hello NixOS!
|
|
|
|
'');
|
2023-04-30 00:54:24 +00:00
|
|
|
}
|
|
|
|
];
|
2023-04-16 23:24:06 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
testScript = { nodes, ... }: ''
|
|
|
|
geminiserver.wait_for_unit("stargazer")
|
|
|
|
geminiserver.wait_for_open_port(1965)
|
|
|
|
|
|
|
|
with subtest("check is serving over gemini"):
|
|
|
|
response = geminiserver.succeed("${pkgs.gmni}/bin/gmni -j once -i -N gemini://localhost:1965")
|
|
|
|
print(response)
|
|
|
|
assert "Hello NixOS!" in response
|
|
|
|
'';
|
|
|
|
}
|