From 3b3e7093beb225810a728b44f31afeb24f2f247c Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Fri, 6 Oct 2023 23:11:46 +0200 Subject: [PATCH] modules: services: pirate: make more fine-grained --- modules/services/pirate/default.nix | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/modules/services/pirate/default.nix b/modules/services/pirate/default.nix index 7c341e7..59f9794 100644 --- a/modules/services/pirate/default.nix +++ b/modules/services/pirate/default.nix @@ -29,7 +29,7 @@ let ]; }; - mkFail2Ban = service: { + mkFail2Ban = service: lib.mkIf cfg.${service}.enable { services.fail2ban.jails = { ${service} = '' enabled = true @@ -47,14 +47,30 @@ let }; }; - mkFullConfig = service: lib.mkMerge [ + mkFullConfig = service: lib.mkIf cfg.${service}.enable (lib.mkMerge [ (mkService service) (mkRedirection service) - ]; + ]); in { options.my.services.pirate = { enable = lib.mkEnableOption "Media automation"; + + bazarr = { + enable = lib.my.mkDisableOption "Bazarr"; + }; + + lidarr = { + enable = lib.my.mkDisableOption "Lidarr"; + }; + + radarr = { + enable = lib.my.mkDisableOption "Radarr"; + }; + + sonarr = { + enable = lib.my.mkDisableOption "Sonarr"; + }; }; config = lib.mkIf cfg.enable (lib.mkMerge [