diff --git a/hosts/hackens-org/modules/webhook.nix b/hosts/hackens-org/modules/webhook.nix index 0ec683c..62d3562 100644 --- a/hosts/hackens-org/modules/webhook.nix +++ b/hosts/hackens-org/modules/webhook.nix @@ -5,6 +5,7 @@ let cfg = config.services.webhook; debug = config.my.debug; in +{ options.services.webhook = { enable = mkEnableOption "Set up webhooks"; pkg = mkOption { @@ -25,7 +26,7 @@ in type = types.listOf (types.submodule { options = mkOption { type = json.type; - description = "Configuration for this webhook, check for supported values" + description = "Configuration for this webhook, check for supported values"; }; }); description = "An list of enabled webhooks"; @@ -38,9 +39,11 @@ in }; config = mkIf cfg.enable { services.nginx = { - enableACME = if debug then false else true; enable = true; - virtualHosts."${cfg.hostname}".locations."${endpoint}".proxyPass = "http://127.0.0.1:${cfg.internalPort}/hooks"; + virtualHosts."${cfg.hostname}" = { + locations."${endpoint}".proxyPass = "http://127.0.0.1:${cfg.internalPort}/hooks"; + enableACME = if debug then false else true; + }; }; systemd.services.webhook = { unitConfig = { @@ -51,5 +54,6 @@ in ExecStart = "${cfg.pkg} -ip \"127.0.0.1\" -port \"${cfg.internalPort}\" -verbose -hooks ${json.generate "conf.json" cfg.hooks}"; }; wantedBy = [ "mulit-user.target" ]; - + }; + }; }