1{ lib, pkgs, ... }:
2{
3 name = "sshwifty";
4
5 nodes.machine =
6 { ... }:
7 {
8 services.sshwifty = {
9 enable = true;
10 sharedKeyFile = pkgs.writeText "sharedkey" "rpz2E4QI6uPMLr";
11 settings = {
12 HostName = "localhost";
13 Servers = [
14 {
15 ListenInterface = "::1";
16 ListenPort = 80;
17 ServerMessage = "NixOS test";
18 }
19 ];
20 };
21 };
22 };
23
24 testScript = ''
25 machine.wait_for_unit("sshwifty.service")
26 machine.wait_for_open_port(80)
27 machine.wait_until_succeeds("curl --fail -6 http://localhost/", timeout=60)
28 machine.wait_until_succeeds("${lib.getExe pkgs.nodejs} ${./sshwifty-test.js}", timeout=60)
29 '';
30
31 meta.maintainers = [ lib.maintainers.ungeskriptet ];
32}