From 099202c63feca02b55d3e7b4e9cac63c7350a038 Mon Sep 17 00:00:00 2001 From: Soispha Peetz Date: Wed, 4 Nov 2026 21:12:17 +0100 Subject: modules/anubis: Add enable option Otherwise, it would always be enabled. --- modules/by-name/an/anubis/module.nix | 50 +++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 23 deletions(-) (limited to 'modules/by-name/an') diff --git a/modules/by-name/an/anubis/module.nix b/modules/by-name/an/anubis/module.nix index 4e70e4f..4140b28 100644 --- a/modules/by-name/an/anubis/module.nix +++ b/modules/by-name/an/anubis/module.nix @@ -29,34 +29,38 @@ }) cfg.instances; in { - options.vhack.anubis.instances = lib.mkOption { - description = '' - Protect this reverse proxy with anubis. - - The attr key is the subdomain, the value the config. - ''; - - type = lib.types.attrsOf (lib.types.submodule { - options = { - target = lib.mkOption { - description = "nginx `proxyPass` target"; - type = lib.types.str; - example = "http://127.0.0.1:8080"; + options.vhack.anubis = { + enable = lib.mkEnableOption "anubis"; + + instances = lib.mkOption { + description = '' + Protect this reverse proxy with anubis. + + The attr key is the subdomain, the value the config. + ''; + + type = lib.types.attrsOf (lib.types.submodule { + options = { + target = lib.mkOption { + description = "nginx `proxyPass` target"; + type = lib.types.str; + example = "http://127.0.0.1:8080"; + }; }; - }; - config = {}; - }); + config = {}; + }); - default = {}; + default = {}; - example = lib.literalExample '' - { - target = "http://127.0.0.1:$${toString config.servies..port}"; - } - ''; + example = lib.literalExample '' + { + target = "http://127.0.0.1:$${toString config.servies..port}"; + } + ''; + }; }; - config = { + config = lib.mkIf cfg.enable { users = { users.nginx.extraGroups = [ config.services.anubis.defaultOptions.group -- cgit v1.3.1