modules: services: indexers: refactor

This is cleaner and more correct.
This commit is contained in:
Bruno BELANYI 2021-10-15 15:10:03 +02:00
parent 760e24a356
commit df1bc0d0d5

View file

@ -12,8 +12,9 @@ in
nzbhydra.enable = mkEnableOption "NZBHydra2 usenet meta-indexer"; nzbhydra.enable = mkEnableOption "NZBHydra2 usenet meta-indexer";
}; };
config = { config = lib.mkMerge [
services.jackett = lib.mkIf cfg.jackett.enable { (lib.mkIf cfg.jackett.enable {
services.jackett = {
enable = true; enable = true;
}; };
@ -25,19 +26,25 @@ in
}; };
}; };
services.nzbhydra2 = lib.mkIf cfg.nzbhydra.enable {
enable = true;
};
my.services.nginx.virtualHosts = [ my.services.nginx.virtualHosts = [
{ {
subdomain = "jackett"; subdomain = "jackett";
port = jackettPort; port = jackettPort;
} }
];
})
(lib.mkIf cfg.nzbhydra.enable {
services.nzbhydra2 = {
enable = true;
};
my.services.nginx.virtualHosts = [
{ {
subdomain = "nzbhydra"; subdomain = "nzbhydra";
port = nzbhydraPort; port = nzbhydraPort;
} }
]; ];
}; })
];
} }