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
1 changed files with 32 additions and 25 deletions

View File

@ -12,32 +12,39 @@ in
nzbhydra.enable = mkEnableOption "NZBHydra2 usenet meta-indexer";
};
config = {
services.jackett = lib.mkIf cfg.jackett.enable {
enable = true;
};
# Jackett wants to eat *all* my RAM if left to its own devices
systemd.services.jackett = {
serviceConfig = {
MemoryHigh = "15%";
MemoryMax = "25%";
config = lib.mkMerge [
(lib.mkIf cfg.jackett.enable {
services.jackett = {
enable = true;
};
};
services.nzbhydra2 = lib.mkIf cfg.nzbhydra.enable {
enable = true;
};
# Jackett wants to eat *all* my RAM if left to its own devices
systemd.services.jackett = {
serviceConfig = {
MemoryHigh = "15%";
MemoryMax = "25%";
};
};
my.services.nginx.virtualHosts = [
{
subdomain = "jackett";
port = jackettPort;
}
{
subdomain = "nzbhydra";
port = nzbhydraPort;
}
];
};
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;
}
];
})
];
}