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";
};
config = {
services.jackett = lib.mkIf cfg.jackett.enable {
config = lib.mkMerge [
(lib.mkIf cfg.jackett.enable {
services.jackett = {
enable = true;
};
@ -25,19 +26,25 @@ in
};
};
services.nzbhydra2 = lib.mkIf cfg.nzbhydra.enable {
enable = true;
};
my.services.nginx.virtualHosts = [
{
subdomain = "jackett";
port = jackettPort;
}
];
})
(lib.mkIf cfg.nzbhydra.enable {
services.nzbhydra2 = {
enable = true;
};
my.services.nginx.virtualHosts = [
{
subdomain = "nzbhydra";
port = nzbhydraPort;
}
];
};
})
];
}