c7e6337bd0
GitOrigin-RevId: 08e4dc3a907a6dfec8bb3bbf1540d8abbffea22b
30 lines
750 B
Nix
30 lines
750 B
Nix
{ pkgs, lib, ... }:
|
|
{
|
|
name = "stargazer";
|
|
meta = with lib.maintainers; { maintainers = [ gaykitty ]; };
|
|
|
|
nodes = {
|
|
geminiserver = { pkgs, ... }: {
|
|
services.stargazer = {
|
|
enable = true;
|
|
routes = {
|
|
"localhost" = {
|
|
root = toString (pkgs.writeTextDir "index.gmi" ''
|
|
# Hello NixOS!
|
|
'');
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
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
|
|
'';
|
|
}
|