1{ lib, ... }:
2{
3 name = "sabnzbd";
4 meta.maintainers = with lib.maintainers; [ jojosch ];
5
6 node.pkgsReadOnly = false;
7
8 nodes.machine =
9 { lib, ... }:
10 {
11 services.sabnzbd = {
12 enable = true;
13 };
14
15 # unrar is unfree
16 nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ "unrar" ];
17 };
18
19 testScript = ''
20 machine.wait_for_unit("sabnzbd.service")
21 machine.wait_until_succeeds(
22 "curl --fail -L http://localhost:8080/"
23 )
24 _, out = machine.execute("grep SABCTools /var/lib/sabnzbd/logs/sabnzbd.log")
25 machine.log(out)
26 machine.fail("grep 'SABCTools disabled: no correct version found!' /var/lib/sabnzbd/logs/sabnzbd.log")
27 '';
28}