1{
2 pkgs,
3 lib,
4 ...
5}:
6
7{
8 name = "botamusique";
9 meta.maintainers = with lib.maintainers; [ hexa ];
10
11 nodes = {
12 machine =
13 { config, ... }:
14 {
15 networking.extraHosts = ''
16 127.0.0.1 all.api.radio-browser.info
17 '';
18
19 services.murmur = {
20 enable = true;
21 registerName = "NixOS tests";
22 };
23
24 services.botamusique = {
25 enable = true;
26 settings = {
27 server = {
28 channel = "NixOS tests";
29 };
30 bot = {
31 version = false;
32 auto_check_update = false;
33 };
34 };
35 };
36 };
37 };
38
39 testScript = ''
40 start_all()
41
42 machine.wait_for_unit("murmur.service")
43 machine.wait_for_unit("botamusique.service")
44
45 machine.sleep(10)
46
47 machine.wait_until_succeeds(
48 "journalctl -u murmur.service -e | grep -q '<1:botamusique(-1)> Authenticated'"
49 )
50
51 with subtest("Check systemd hardening"):
52 output = machine.execute("systemctl show botamusique.service")[1]
53 machine.log(output)
54 output = machine.execute("systemd-analyze security botamusique.service")[1]
55 machine.log(output)
56 '';
57}