94427deb9d
GitOrigin-RevId: f91ee3065de91a3531329a674a45ddcb3467a650
31 lines
768 B
Nix
31 lines
768 B
Nix
{ pkgs, lib, ... }:
|
|
{
|
|
name = "stargazer";
|
|
meta = with lib.maintainers; { maintainers = [ gaykitty ]; };
|
|
|
|
nodes = {
|
|
geminiserver = { pkgs, ... }: {
|
|
services.stargazer = {
|
|
enable = true;
|
|
routes = [
|
|
{
|
|
route = "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
|
|
'';
|
|
}
|