1{ pkgs, ... }:
2{
3 name = "icingaweb2";
4 meta = {
5 maintainers = pkgs.lib.teams.helsinki-systems.members;
6 };
7
8 nodes = {
9 icingaweb2 =
10 { config, pkgs, ... }:
11 {
12 services.icingaweb2 = {
13 enable = true;
14
15 modulePackages = with pkgs.icingaweb2Modules; {
16 particles = theme-particles;
17 spring = theme-spring;
18 };
19
20 modules = {
21 doc.enable = true;
22 migrate.enable = true;
23 setup.enable = true;
24 test.enable = true;
25 translation.enable = true;
26 };
27
28 generalConfig = {
29 global = {
30 module_path = "${pkgs.icingaweb2}/modules";
31 };
32 };
33
34 authentications = {
35 icingaweb = {
36 backend = "external";
37 };
38 };
39
40 groupBackends = {
41 icingaweb = {
42 backend = "db";
43 resource = "icingaweb_db";
44 };
45 };
46
47 resources = {
48 # Not used, so no DB server needed
49 icingaweb_db = {
50 type = "db";
51 db = "mysql";
52 host = "localhost";
53 username = "icingaweb2";
54 password = "icingaweb2";
55 dbname = "icingaweb2";
56 };
57 };
58
59 roles = {
60 Administrators = {
61 users = "*";
62 permissions = "*";
63 };
64 };
65 };
66 };
67 };
68
69 testScript = ''
70 start_all()
71 icingaweb2.wait_for_unit("multi-user.target")
72 icingaweb2.succeed("curl -sSf http://icingaweb2/authentication/login")
73 '';
74}