vuls: init at 0.27.0
[NixPkgs.git] / nixos / tests / mobilizon.nix
blob2b070ca9d96091b5b58d6db79ac43a59dc66c581
1 import ./make-test-python.nix ({ lib, ... }:
2   let
3     certs = import ./common/acme/server/snakeoil-certs.nix;
4     mobilizonDomain = certs.domain;
5     port = 41395;
6   in
8   {
9     name = "mobilizon";
10     meta.maintainers = with lib.maintainers; [ minijackson erictapen ];
12     nodes.server =
13       { ... }:
14       {
15         services.mobilizon = {
16           enable = true;
17           settings = {
18             ":mobilizon" = {
19               ":instance" = {
20                 name = "Test Mobilizon";
21                 hostname = mobilizonDomain;
22               };
23               "Mobilizon.Web.Endpoint".http.port = port;
24             };
25           };
26         };
28         security.pki.certificateFiles = [ certs.ca.cert ];
30         services.nginx.virtualHosts."${mobilizonDomain}" = {
31           enableACME = lib.mkForce false;
32           sslCertificate = certs.${mobilizonDomain}.cert;
33           sslCertificateKey = certs.${mobilizonDomain}.key;
34         };
36         networking.hosts."::1" = [ mobilizonDomain ];
37       };
39     testScript = ''
40       server.wait_for_unit("mobilizon.service")
41       server.wait_for_open_port(${toString port})
42       server.succeed("curl --fail https://${mobilizonDomain}/")
43     '';
44   })