1 import ../make-test-python.nix ({ pkgs, lib, ... }:
3 domain = "sourcehut.localdomain";
8 meta.maintainers = with pkgs.lib.maintainers; [ tomberek nessdoor ];
10 nodes.machine = { config, pkgs, nodes, ... }: {
15 networking.domain = domain;
16 networking.extraHosts = ''
17 ${config.networking.primaryIPAddress} builds.${domain}
18 ${config.networking.primaryIPAddress} meta.${domain}
21 services.sourcehut = {
24 # FIXME: see why it does not seem to activate fully.
29 settings."builds.sr.ht" = {
30 oauth-client-secret = pkgs.writeText "buildsrht-oauth-client-secret" "2260e9c4d9b8dcedcef642860e0504bc";
31 oauth-client-id = "299db9f9c2013170";
38 machine.wait_for_unit("multi-user.target")
40 with subtest("Check whether meta comes up"):
41 machine.wait_for_unit("metasrht-api.service")
42 machine.wait_for_unit("metasrht.service")
43 machine.wait_for_unit("metasrht-webhooks.service")
44 machine.wait_for_open_port(5000)
45 machine.succeed("curl -sL http://localhost:5000 | grep meta.${domain}")
46 machine.succeed("curl -sL http://meta.${domain} | grep meta.${domain}")
48 with subtest("Check whether builds comes up"):
49 machine.wait_for_unit("buildsrht.service")
50 machine.wait_for_open_port(5002)
51 machine.succeed("curl -sL http://localhost:5002 | grep builds.${domain}")
52 #machine.wait_for_unit("buildsrht-worker.service")