Caddy: Difference between revisions
Added instructions to build Caddy with plugins. |
|||
| Line 239: | Line 239: | ||
* [https://caddyserver.com/docs/caddyfile/directives/tls Caddy TLS settings documentation] | * [https://caddyserver.com/docs/caddyfile/directives/tls Caddy TLS settings documentation] | ||
== Adding Plugins == | |||
Caddy supports being extended with plugins, which must be added during the build process<ref>https://github.com/caddyserver/caddy?tab=readme-ov-file#with-version-information-andor-plugins</ref>. The simplest option to do this in Nix is by using an override to build a customized version of Caddy. | |||
Follow the instructions for [https://github.com/caddyserver/caddy?tab=readme-ov-file#with-version-information-andor-plugins setting up Caddy to build with plugins], either by using xcaddy, or following the manual steps. In your configuration, override Caddy to build using this local Go module. If you created the main.go file in the same location as your caddy Nix config, it can look something like this: | |||
<syntaxhighlight lang="nix"> | |||
services.caddy.package = pkgs.caddy.overrideAttrs ( | |||
self: super: { | |||
src = ./.; | |||
vendorHash = ""; | |||
subPackages = [ ]; | |||
} | |||
); | |||
</syntaxhighlight> | |||
== See also == | == See also == | ||