diff --git a/modules/services/indexers/default.nix b/modules/services/indexers/default.nix index 0d272f8..af0f482 100644 --- a/modules/services/indexers/default.nix +++ b/modules/services/indexers/default.nix @@ -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; + } + ]; + }) + ]; }