diff options
| author | Soispha Peetz <soispha@b-peetz.de> | 2026-11-04 21:12:17 +0100 |
|---|---|---|
| committer | Soispha Peetz <soispha@b-peetz.de> | 2026-11-27 00:55:52 +0100 |
| commit | 099202c63feca02b55d3e7b4e9cac63c7350a038 (patch) | |
| tree | 98f888e52c39aa7c77bd7f1f5cb32ff02d0e596b | |
| parent | hosts/{server2,server3}: Deduplicate some configuration via `modules/common` (diff) | |
| download | nixos-server-099202c63feca02b55d3e7b4e9cac63c7350a038.zip | |
modules/anubis: Add enable option
Otherwise, it would always be enabled.
| -rw-r--r-- | modules/by-name/an/anubis/module.nix | 46 |
1 files changed, 25 insertions, 21 deletions
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. + options.vhack.anubis = { + enable = lib.mkEnableOption "anubis"; - The attr key is the subdomain, the value the config. - ''; + instances = lib.mkOption { + description = '' + Protect this reverse proxy with anubis. - 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"; + 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.<name>.port}"; - } - ''; + example = lib.literalExample '' + { + target = "http://127.0.0.1:$${toString config.servies.<name>.port}"; + } + ''; + }; }; - config = { + config = lib.mkIf cfg.enable { users = { users.nginx.extraGroups = [ config.services.anubis.defaultOptions.group |
