nixos/roles/caddy.nix

24 lines
605 B
Nix

{
config,
pkgs,
inputs,
...
}:
{
services.caddy = {
enable = true;
package = pkgs.caddy.withPlugins {
plugins = [ "github.com/tailscale/caddy-tailscale@f21c01b660c896bdd6bacc37178dc00d9af282b4" ];
hash = "sha256-pqM4d4MAKvIJ5O7VkrHDqu36LDTOzUoBa6m4D20wlyw=";
};
email = "nolan@thewordnerd.info";
};
age.secrets.tsAuthKey = {
file = ../secrets/ts_auth_key.age;
owner = config.services.caddy.user;
group = config.services.caddy.group;
mode = "600";
};
systemd.services.caddy.serviceConfig.EnvironmentFile = config.age.secrets.tsAuthKey.path;
}